Google IAP v3 crashing on store.init()

Yes I do. 

Uploaded it and checked, everything is working. Really strange issue. Just like it did stopped working, it started back again.

Maybe there is some licensing issue since people who don’t put security key in config experience same issue.

Hello,

I’ve just published my game - https://play.google.com/store/apps/details?id=com.thatssopanda.wordmixup - and the IAPs are correctly working. Like Rob Miracle stated, I’m working with the Corona Support Staff (who have been great) on finding out the problem. They’ve given me a test plugin to use and hopefully they’ll be able to find out the source of the issue.

Just out of curiosity, everyone having issues with IAP are you Starter or Basic subscribers?  The forums show you as Starter accounts and IAP requires a Basic subscription level.

@rohit.r, You will have to upload an Alpha build to enable a few things but after that you can just sideload your app directly onto your Android device for testing.

Hi Rob,

I have uploaded my alpha build but still i am facing the same issue though i tried to test it after downloading it from Google play.

Also my personal account is registered as a Starter but i have my separate Pro version of corona that is licensed by our organisation.

Hello @rob,

We are using pro version which is provided by our organization.

But for the forums we use our own accounts.

@Thatssopanda, Can you just have a look into my build.settings and config.lua right here

http://forums.coronalabs.com/topic/51047-in-app-purchases-iap-storeinit-freezes-the-application/#entry277172

Can you please let us know the update on this IAP issue.

~Thanks

My company has license, on forum I am using my own account.

Im experiencing the same problem. Game crashes with no error message after store.init( “google”, transactionCallback ). Basic User. It doesn’t crash consistently though.

Its appears calling store.init with a timer alleviates the issue. 

@rohan.k

Have you tried re-building your app? I don’t know if they’ve adjusted anything with the IAP plugin, but when I took out ‘supportedPlatforms = { android=true }’ it seemed to work for me. I published my game without this and IAPs worked in the store.

@havochare4

Do you have a logcat for the crashes? It helps the Corona team with debugging if you can provide more information about the crashes.

If you leave this out:   supportedPlatforms = { android=true }

When you try and build for iOS you will get a build error because this plugin does not exist for iOS.  If leaving that line out causes it to seem to work, then perhaps there is a build error around having that line in.  Please post your build.settings inside and tags (leaving out the space of course).

As for logs, please run:

adb logcat

Do not run:

adb logcat Corona:v *:s

This later version only shows you messages from the Corona activity.  When you would with an outside activity like the Google Play Store app, it will generate it’s own messages.  I realize Android is going to dump an ton of junk messages on you, but you have to see what’s going on outside of Corona’s control.

@thatssopanda, I have removed the supportedPlatforms = { android=true } and still the issue is observed.

I have used adb logcat now, and i have attached the log, please have a look.

@Rob Here is my build.settings.

settings = {     orientation = {         default = "landscapeRight",         supported =                 {                         "landscapeLeft", "landscapeRight"                 },     },     iphone =     {         plist=         {             UIStatusBarHidden=true,             UIViewControllerBasedStatusBarAppearance = false,             CFBundleIconFile = "Icon.png",             CFBundleIconFiles = {                "Icon.png",                "Icon@2x.png",                "Icon-76.png",                "Icon-76@2x.png",                "Icon-72.png",                "Icon-72@2x.png",                "Icon-512.png",                "Icon-512@2x.png"             },             UIApplicationExitsOnSuspend = false,              FacebookAppID = "fb25634XXXXXXXXX",             UIAppFonts={      "customfont.ttf","CALIBRI.TTF","CALIBRIB.TTF","comic.ttf","comicbd.ttf","minya\_nouvelle\_rg.ttf","chinacat.TTF","Doctor Soos Light.ttf" },             CFBundleURLTypes =             {                 {                     CFBundleURLSchemes =                     {                            "fb25634XXXXXXXXX",-- replace XXXXXXXXX with your facebook appId                     }                 }             }         }         },         android =     {         versionCode = "18",         usesPermissions =         {             "android.permission.RECORD\_AUDIO",             "android.permission.INTERNET",               "com.android.vending.BILLING",              "com.android.vending.CHECK\_LICENSE",              "android.permission.CAMERA",         },         usesFeatures =         {             { name = "android.hardware.camera", required = false },                    },     },     plugins =     {         ["plugin.google.play.services"] =         {             publisherId = "com.coronalabs"         },            ["CoronaProvider.analytics.flurry"] =         {             publisherId = "com.coronalabs",         },         ["facebook"] =           {            publisherId = "com.coronalabs",           },         ["plugin.google.iap.v3"] =          {           publisherId = "com.coronalabs",         -- supportedPlatforms = { android=true }             },     },     }

Hello!

I’m trying to set up Google IAP v3 on my game and when I call store.init(), my app crashes. I’m testing the game on my device which is a Samsung Galaxy Tab 3 and I’m using Corona Version 2014.2511 (2014.11.18).

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

I haven’t read the whole thread yet, but shouldn’t the license part be in config.lua instad of build.settings!?

With the license missing the app will crash.

The license table is part of the config.lua, for instance:

local aspectRatio = display.pixelHeight / display.pixelWidth

--config.lua application = { &nbsp;&nbsp; content = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width = aspectRatio \> 1.5 and 320 or math.ceil( 480 / aspectRatio ), &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height = aspectRatio \< 1.5 and 480 or math.ceil( 320 \* aspectRatio ), &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; scale = "letterbox", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fps = 60, &nbsp;&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; imageSuffix = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ["@2x"] = 1.5, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ["@4x"] = 3.0, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp; }, &nbsp;&nbsp; license = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; google = { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; key = "biglongGooglekey", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; policy = "serverManaged", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp; }, }

@rohan.k

You will need the supported devices line if you plan to build for iOS. Taking it in and out should have no effect on this issue.  If you’re getting an error with it in, I’d like to know what that error is.

Secondly, is there any way to build on a Mac?  The screen shots you posted of your log doesn’t have any messages that appear to either come from your app or from Google Play.  Please do:

print("**************BEFORE store.init*******************")

store.init(“google”, transactionCallback) – or whatever function you’re calling

print("**************AFTER store.init*********************")

This will help you isolate the relevant messages in your console log dump.  It’s much better to copy/paste the messages as text rather than try to do screen grabs.

Next, please try and build the  SampleCode/Store/InAppPurchase sample and see if it has the same issue.  It seems that you’re the only one struggling with this now, which tells me the issue with the plugin has been fixed.

Rob

@rob @thatssopanda @delwing

Thank you everyone for the help.

The Store is working fine now.

Even I removed  native.setActivityIndicator(false) from my code.

~Thanks.

Hi guys,

I am having this issue right now. store.init() on some* Android devices just hangs the system. No error messages or any debug messages right after the line where i call store.init().

I am using the latest public stable build 2511. When i revert to iap v2 everythings working fine (but google not accepting it since Feb 01 as you know). iap v3 is just not working.

By the way, i am a PRO subscriber, but also evaluating enterprise edition. Thats why forum tags me as “Enterprise”. So i am using the plugin version of iap v3.

Any ideas?

Hi @deniz,

So to be clear, you’re using the non-Enterprise method of just require()-ing the IAP v3 plugin? Did you follow through the multiple steps involved in setting it up for Android, for example, including the BILLING permission and specifying your license key? Please see this guide for details:

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

Best regards,

Brent

Yes, i am using corona as a regular PRO subscriber (server build). I read all the messages on this topic and i got exactly the same config.lua and build.settings files as stated on IAP documentation.

Just a side note: when i call store.init a little bit delayed* such as;

timer.performWithDelay(100, function() store.init("google", myStoreCallback) end)

everything seems fine on my test device. 

Hi @deniz,

OK, and before this timer approach, when were you initializing it? Immediately on app launch within main.lua?

Brent

No, my app is a multiplayer game actually. I try to initialize the store after the user login to my server. Its about 300ms right after the app lunch i guess. 

By the way; This problem does occur in some of my players’ devices. So I can not test the case on a stripped example. All I can say is; the same code is working fine with iap v2.

Hi @deniz,

Can you please post the build.settings code and verify the licence key in   config.lua.

As i was using  [lua] native.setActivityIndicator(false) [/lua] in my store code, removing this solved the issue.