Google IAP v3 not loading

Hi there,

I´m trying to use Google API v3 in a game for Android. 

I’ve set up everything as indicated in Corona docs: 

http://docs.coronalabs.com/daily/plugin/google-iap-v3/

http://docs.coronalabs.com/daily/guide/monetization/IAP/index.html

Everything seem to be ok in the files involved: build.settings, config.lua and and in the lua file where I manage in-app purchases. 

But when I try to test it in a device I get this error in the console (see atached screenshot 1). The error comes from this line of code: see attached screenshot 2).

I’m using the last daily build of Corona SDK (2404), just in case that could be the problem. 

Has this ever happened to you guys? What am I missing here?

Thanks in advance. 

Hi @pinfloy,

Instead of require()-ing “store” then overwriting it with the plugin, try the following bit and see if anything changes:

[lua]

local store

local v3 = false

if ( system.getInfo( “platformName” ) == “Android” ) then

    store = require( “plugin.google.iap.v3” )

    v3 = true

elseif ( system.getInfo( “platformName” ) == “iPhone OS” ) then

    store = require( “store” )

else

    native.showAlert( “Notice”, “In-app purchases are not supported in the Corona Simulator.”, { “OK” } )

end

[/lua]

(Note that the guide has been updated with this code bit, but the plugin doc page isn’t yet).

Also, may I ask why you’re using the “module(…,package.seeall)” line? This is very outdated Lua code and you shouldn’t use it any longer.

Take care,

Brent

Battling similar issues but using the latest release build:

:frowning:

http://forums.coronalabs.com/topic/50476-trouble-getting-google-play-to-work/?p=261553

Hi Brent,

thanks for your response and your tips. I applied them but they didn’t seem to work. I keep getting the same “Google IAPv3” loading error when trying to execute the app in my device.

What else can be the problem?

** UPDATE **

I’ve just realised that the problem is not related to the IAP plugin. If I comment out that code the app fails again with the next plugin it tries to load. Something seems to be wrong with that LuaLoader, doesn’t it? See attached sreenshot

Thanks!

Ok, the problem was in the build.settings file, the plugins section was placed incorrectly. 

Hi @pinfloy,

Instead of require()-ing “store” then overwriting it with the plugin, try the following bit and see if anything changes:

[lua]

local store

local v3 = false

if ( system.getInfo( “platformName” ) == “Android” ) then

    store = require( “plugin.google.iap.v3” )

    v3 = true

elseif ( system.getInfo( “platformName” ) == “iPhone OS” ) then

    store = require( “store” )

else

    native.showAlert( “Notice”, “In-app purchases are not supported in the Corona Simulator.”, { “OK” } )

end

[/lua]

(Note that the guide has been updated with this code bit, but the plugin doc page isn’t yet).

Also, may I ask why you’re using the “module(…,package.seeall)” line? This is very outdated Lua code and you shouldn’t use it any longer.

Take care,

Brent

Battling similar issues but using the latest release build:

:frowning:

http://forums.coronalabs.com/topic/50476-trouble-getting-google-play-to-work/?p=261553

Hi Brent,

thanks for your response and your tips. I applied them but they didn’t seem to work. I keep getting the same “Google IAPv3” loading error when trying to execute the app in my device.

What else can be the problem?

** UPDATE **

I’ve just realised that the problem is not related to the IAP plugin. If I comment out that code the app fails again with the next plugin it tries to load. Something seems to be wrong with that LuaLoader, doesn’t it? See attached sreenshot

Thanks!

Ok, the problem was in the build.settings file, the plugins section was placed incorrectly.