Google Licensing Error - Configuration Event

Im trying to use Google Play Licensing… 

I keep getting an error type… configuration event. 

I guess there is something wrong with my config file… anyone know what?

local aspectRatio = display.pixelHeight / display.pixelWidth

application = {

        content = {

                width = aspectRatio > 1.5 and 800 or math.ceil( 1200 / aspectRatio ),

                height = aspectRatio < 1.5 and 1200 or math.ceil( 800 * aspectRatio ),

                scale = ‘letterbox’,

                fps = 60,

                imageSuffix = {

                        [’@2x’] = 1.1,

                        [’@4x’] = 2.1

                },

        },

    license = {google = {key =“key”,

policy = “serverManaged”

},

},

}

Hi @havochare4,

Did you remember to include and initialize the licensing.* library in your main.lua file?

http://docs.coronalabs.com/guide/basics/configSettings/index.html#licensing

Brent

Yeah, I included it and initialized it… This is what the main.lua looks like. 

[lua]

local composer = require( “composer” )

local licensing = require(“licensing”)

licensing.init( “google” )

local function licensingListener( event )

print(“made it to licensing listener”)

print(event.errorType …“event errorType”) – says configurationerror

print(event.expiration …“event expiration”) --says 0

print(event.isError) – say true

print(“event isError Above”)

print(event.isVerified) – says false

print(“is Verifired Above”)

print(event.name …“event name”) 

print(event.provider …“event provider”)

print(event.response …“event response”) – says not managed product or something like that.

 if event.isVerified then

print(“my license was verified”)

startGame()

composer.gotoScene( “mainMenu” )

  else

print(“my license failed”)

      native.showAlert( “Licensing Failed!”, “There was a problem verifying the application, please try again.”, { “OK” } )

    end

end

if system.getInfo(“environment”) == “simulator” then

startGame()

print(“It thinks Im in the sumulator”)

composer.gotoScene( “mainMenu” )

else 

print(“Its determined Im not in the simulator, and calling the license listener”)

licensing.verify( licensingListener )

end

[/lua]

Hi @havochare4,

I know this is an obvious question, but is your licensing key fully set up and operational on Google’s side?

Brent

As far as I know it is set up. I got a key out of the Services and APIs page… Base64-encoded RSA public key to include in your binary. Please remove any spaces. The key located under that bit of text.

Its an alpha build. Does that matter?

I just updated the alpha apk in the google developer console to the most current version that I have, Ran the app again and still getting the same message… Configurationevent error type. 

Is that the error you would get if the key happened to be invalid?

Hi @havochare4,

Did you remember to include and initialize the licensing.* library in your main.lua file?

http://docs.coronalabs.com/guide/basics/configSettings/index.html#licensing

Brent

Yeah, I included it and initialized it… This is what the main.lua looks like. 

[lua]

local composer = require( “composer” )

local licensing = require(“licensing”)

licensing.init( “google” )

local function licensingListener( event )

print(“made it to licensing listener”)

print(event.errorType …“event errorType”) – says configurationerror

print(event.expiration …“event expiration”) --says 0

print(event.isError) – say true

print(“event isError Above”)

print(event.isVerified) – says false

print(“is Verifired Above”)

print(event.name …“event name”) 

print(event.provider …“event provider”)

print(event.response …“event response”) – says not managed product or something like that.

 if event.isVerified then

print(“my license was verified”)

startGame()

composer.gotoScene( “mainMenu” )

  else

print(“my license failed”)

      native.showAlert( “Licensing Failed!”, “There was a problem verifying the application, please try again.”, { “OK” } )

    end

end

if system.getInfo(“environment”) == “simulator” then

startGame()

print(“It thinks Im in the sumulator”)

composer.gotoScene( “mainMenu” )

else 

print(“Its determined Im not in the simulator, and calling the license listener”)

licensing.verify( licensingListener )

end

[/lua]

Hi @havochare4,

I know this is an obvious question, but is your licensing key fully set up and operational on Google’s side?

Brent

As far as I know it is set up. I got a key out of the Services and APIs page… Base64-encoded RSA public key to include in your binary. Please remove any spaces. The key located under that bit of text.

Its an alpha build. Does that matter?

I just updated the alpha apk in the google developer console to the most current version that I have, Ran the app again and still getting the same message… Configurationevent error type. 

Is that the error you would get if the key happened to be invalid?