Amazon IAP plugin causes Android app lock up

Corona SDK version: 2015.2799

I’ve recently started to port my game over to the Amazon app store but noticed that on start up, the Amazon version of the game greeted me with a unexciting black screen.

The simulator version of the game works just fine but on-device testing showed a problem. Via ADB debugging, I notice that logging stopped right after the game initialised the IAP plugin, which incidentally is called before the first game screen is loaded.

superduper:android-sdk-macosx noodle$ platform-tools/adb logcat Corona:v *:s

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

--------- beginning of system

--------- beginning of main

V/Corona  (16610): > Class.forName: network.LuaLoader

V/Corona  (16610): < Class.forName: network.LuaLoader

V/Corona  (16610): Loading via reflection: network.LuaLoader

I/Corona  (16610): Platform: SM-G900F / ARM Neon / 5.0 / Adreno ™ 330 / OpenGL ES 3.0 V@84.0 AU@  (CL@) / 2015.2799 / English | GB | en_GB | en

V/Corona  (16610): > Class.forName: plugin.fuse.LuaLoader

V/Corona  (16610): > Class.forName: CoronaProvider.analytics.flurry.LuaLoader

V/Corona  (16610): < Class.forName: CoronaProvider.analytics.flurry.LuaLoader

V/Corona  (16610): Loading via reflection: CoronaProvider.analytics.flurry.LuaLoader

V/Corona  (16610): > Class.forName: plugin.amazon.iap.LuaLoader

V/Corona  (16610): < Class.forName: plugin.amazon.iap.LuaLoader

V/Corona  (16610): Loading via reflection: plugin.amazon.iap.LuaLoader

For the moment, my game starts if the Amazon IAP plugin isn’t initialised so it proves that there is a problem with plugin. Has anyone in the community encountered this before?

if targetStore == “amazon” then

– store = require “plugin.amazon.iap”

– App locks up here!
– store.init( transactionCallback )

elseif targetStore == “google” then

–We’re on Google - init the store
store = require(“plugin.google.iap.v3”)
store.init( “google”, transactionCallback )

elseif targetStore == “apple” then
–We’re on Apple - init the store
store.init( “apple”, transactionCallback )

end

The plugin is configured as follows:

[“plugin.amazon.iap”] =
{
publisherId = “com.amazon”,
supportedPlatforms = { [“android-kindle”] = true },
},

Many thanks

Jonathan

When you do:

adb logcat Corona:v *:s

you only get messages generated by your Corona activity. However you’re talking to other services and you’re filtering out those messages. I know it’s noisy, but you have to just run:

adb logcat

and fight through the unhelpful messages to get to the helpful ones.

Rob

Hi Rob

Thanks for the advice. For reference, the most significant lines in the logcat output to solve this was:

I/PurchasingManager(13318): Purchasing Framework initialization complete. SDK Version 1.0.20.1

D/PurchasingManager(13318): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: plugin.amazon.iap.CoronaPurchasingObserver@24b5d9e6

D/SandboxRequestHandler(13318): In App Purchasing SDK - Sandbox Mode: sendGetUserIdRequest

D/ActivityManager(29562): startService callerProcessName:com.fgl.jm.underground, calleePkgName: com.amazon.mas.test

W/ActivityManager(29562): Unable to start service Intent { act=com.amazon.testclient.iap.appUserId flg=0x10000000 cmp=com.amazon.mas.test/com.amazon.testclient.KickstartService (has extras) } U=0: not found

From here, after a bit of Googling, I had to manually install the v1.0.x of the AmazonSDKTester.apk which is bundled with the latest official Amazon API. Not entirely obvious but seems to solve the problem.

Regards

Jonathan

When you do:

adb logcat Corona:v *:s

you only get messages generated by your Corona activity. However you’re talking to other services and you’re filtering out those messages. I know it’s noisy, but you have to just run:

adb logcat

and fight through the unhelpful messages to get to the helpful ones.

Rob

Hi Rob

Thanks for the advice. For reference, the most significant lines in the logcat output to solve this was:

I/PurchasingManager(13318): Purchasing Framework initialization complete. SDK Version 1.0.20.1

D/PurchasingManager(13318): In App Purchasing SDK - Sandbox Mode: PurchasingObserver registered: plugin.amazon.iap.CoronaPurchasingObserver@24b5d9e6

D/SandboxRequestHandler(13318): In App Purchasing SDK - Sandbox Mode: sendGetUserIdRequest

D/ActivityManager(29562): startService callerProcessName:com.fgl.jm.underground, calleePkgName: com.amazon.mas.test

W/ActivityManager(29562): Unable to start service Intent { act=com.amazon.testclient.iap.appUserId flg=0x10000000 cmp=com.amazon.mas.test/com.amazon.testclient.KickstartService (has extras) } U=0: not found

From here, after a bit of Googling, I had to manually install the v1.0.x of the AmazonSDKTester.apk which is bundled with the latest official Amazon API. Not entirely obvious but seems to solve the problem.

Regards

Jonathan