Google IAP v3 crashing on store.init()

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.

@rohan.k

I am also using native activity indicator all over the application (especially in login sequence). That may be the source of the problem. If this is the case it is very annoying that a simple thing such as a stupid activity indicator causing my app to freeze for no reason.

my build.settings:

settings = {     orientation = {         default = "portrait",         supported = {             "portrait", "portraitUpsideDown",         }             },       iphone = {         plist = {             UIHiddenStatusBar= true, UIPrerenderedIcon = true,                     CFBundleIconFile = "Icon.png",             CFBundleIconFiles = {                 "Icon.png",                 "Icon@2x.png",                 "Icon-60.png",                 "Icon-60@2x.png",                 "Icon-60@3x.png",                 "Icon-72.png",                 "Icon-72@2x.png",                 "Icon-76.png",                 "Icon-76@2x.png",                 "Icon-Small-40.png",                 "Icon-Small-40@2x.png",                 "Icon-Small-40@3x.png",                 "Icon-Small-50.png",                 "Icon-Small-50@2x.png",                 "Icon-Small.png",                 "Icon-Small@2x.png",                 "Icon-Small@3x.png"             },               --launch image files table             UILaunchImages = {                 {  -- iPhone 4 Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  -- iPhone 5 Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 568}"                 },             },            UIApplicationExitsOnSuspend = false,               CFBundleShortVersionString = "2.2",                     FacebookAppID = "MyAppIdXXXXXXX",             CFBundleURLTypes =             {                 {                     CFBundleURLSchemes =                     {                         "fbXXXXXXXXXXXX",                     }                 }             },               ["URL types"] = {                 item = {                     ["URL Schemes"] =                         { ["Item 0"] = "fbXXXXXXXXXXXX" },                 },             },                                      UIAppFonts = {                                                 "HelveticaNeue-CondensedBold.ttf"             },                 },             },       android = {         largeHeap = true,         permissions = {             {                 name = ".permission.C2D\_MESSAGE",                 protectionLevel = "signature"             },         },         usesPermissions = {             "android.permission.INTERNET",             "android.permission.GET\_ACCOUNTS",             "android.permission.RECEIVE\_BOOT\_COMPLETED",             "com.google.android.c2dm.permission.RECEIVE",             "com.android.vending.BILLING",             "com.android.vending.CHECK\_LICENSE",             ".permission.C2D\_MESSAGE",         },     },       plugins =     {           --ADMOB ADSv2 MODULE         ["plugin.google.play.services"] =         {             publisherId = "com.coronalabs",             --supportedPlatforms = { ["ios"] = true, ["android"] = true }         },           -- key is the name passed to Lua's 'require()'         ["CoronaProvider.analytics.flurry"] =         {             -- required             publisherId = "com.coronalabs",         },             ["facebook"] =         {             publisherId = "com.coronalabs",         },           ["CoronaProvider.native.popup.social"] =         {             --required             publisherId = "com.coronalabs",         },           ["plugin.google.iap.v3"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { android=true }         },               },   }

and the config.lua

application = { content = {     width = 320,     height = 480, scale = "letterbox", xAlign="center", yAlign="bottom",       fps = 60,       imageSuffix =       {          ["@2x"] = 1.8,       },        },   notification =     {         iphone =         {             types =             {                 "badge", "sound", "alert", "custom"             }         },         google =         {             projectNumber = "XXXXXXXX",         },     },     license =     {         google =         {             key = "MIIBIjANBgkqhkiG---AND-THE-REST-OF-LICENSE-KEY-GOES-HERE",         },     },       }

Hi @deniz,

Comment the [lua] native.setActivityIndicator() [/lua] wherever you’re using, and check it.

It will solve that freezing issue.

This is still an issue, but I believe only for devices that don’t have certain Google libraries installed. For example, I get the crash using Google’s emulator running Android 4.4.2 (API 17), but not on a 4.4.2 with the Google APIs. 

Well Google IAP requires Google Play to be available so yes, it need’s Google’s APIs

Rob

In my testing, even if Google Play wasn’t installed, I still wouldn’t get the crash on API 17 w/ Google APIs.

But I understand that IAP v3 must be trying to make a call to something in the Google API without checking to see if the Google API is present first, hence the crashing.

I only came across this issue in my app testing on different devices, and I spent a lot of time trying to figure this issue out (thinking it was something in my code), so I’m hoping to save other developers the headache.

Having the same problems. Will try the native.setActivityIndicator() fix - hoping it is just temporary

This is still an issue, but I believe only for devices that don’t have certain Google libraries installed. For example, I get the crash using Google’s emulator running Android 4.4.2 (API 17), but not on a 4.4.2 with the Google APIs. 

Well Google IAP requires Google Play to be available so yes, it need’s Google’s APIs

Rob

In my testing, even if Google Play wasn’t installed, I still wouldn’t get the crash on API 17 w/ Google APIs.

But I understand that IAP v3 must be trying to make a call to something in the Google API without checking to see if the Google API is present first, hence the crashing.

I only came across this issue in my app testing on different devices, and I spent a lot of time trying to figure this issue out (thinking it was something in my code), so I’m hoping to save other developers the headache.