Google Play Game Services strange error during init

Latest release with 1.0 is 1260.

If you are building for Froyo you should be fine, I’m not fluent with all the compatibility stuff on Android, but I think that’s for <= API 7.

Anyway, this looks to be something simple & stupid, which in my experience means most difficult to spot :wink:

Is my assumption correct, that when you build using simulator it works fine?

Are you sure all of the permissions are set ok?

Did you include all of the new activities required by GPGS [if there are any]?

Did you setup properly your intents [if it’s required], so GPGS is able to return/start your game?

How about logs? What’s logged when your app crashes?

Don’t limit your adb logcat to grep Corona/pid. Sometimes it’s something else that reports the error.

Hi krystian6, thanks for responding but I’m sure this will

Is my assumption correct, that when you build using simulator it works fine? -> Yup, build using Corona Pro 1225, runs just fine

I’m gonna answer these 3 questions at the same time :

Are you sure all of the permissions are set ok?

Did you include all of the new activities required by GPGS [if there are any]?

Did you setup properly your intents [if it’s required], so GPGS is able to return/start your game?

Yes, I think… as far as I know my androidmanifest.xml is the exact carbon copy (other than the package name) from the androidmanifest.xml that I grab from the apk that I build using simulator.

 

\<?xml version="1.0" encoding="utf-8" standalone="no"?\>\<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="19" android:versionName="1.5" package="com.iplayalldaystudio.kungfuquest"\> \<uses-permission android:name="android.permission.WRITE\_EXTERNAL\_STORAGE"/\> \<uses-permission android:name="android.permission.INTERNET"/\> \<uses-permission android:name="com.android.vending.CHECK\_LICENSE"/\> \<uses-permission android:name="com.android.vending.BILLING"/\> \<uses-feature android:glEsVersion="0x10001"/\> \<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19"/\> \<uses-feature android:name="android.hardware.telephony" android:required="false"/\> \<uses-feature android:name="android.hardware.screen.portrait" android:required="false"/\> \<uses-feature android:name="android.hardware.screen.landscape" android:required="true"/\> \<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="kqIOS"\> \<meta-data android:name="targetedAppStore" android:value="google"/\> \<meta-data android:name="com.google.android.gms.games.APP\_ID" android:value="219580451XXX"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="kqIOS" android:launchMode="singleTask" android:name="com.ansca.corona.CoronaActivity" android:screenOrientation="landscape" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"\> \<meta-data android:name="supportsOrientationPortrait" android:value="false"/\> \<meta-data android:name="supportsOrientationPortraitUpsideDown" android:value="false"/\> \<meta-data android:name="supportsOrientationLandscapeRight" android:value="true"/\> \<meta-data android:name="supportsOrientationLandscapeLeft" android:value="true"/\> \<intent-filter\> \<action android:name="android.intent.action.MAIN"/\> \<category android:name="android.intent.category.LAUNCHER"/\> \</intent-filter\> \</activity\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.ansca.corona.CameraActivity" android:screenOrientation="portrait" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.ansca.corona.VideoActivity" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.ansca.corona.purchasing.StoreActivity" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.facebook.LoginActivity" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<service android:name="com.ansca.corona.CoronaService"/\> \<receiver android:name="com.ansca.corona.SystemStartupBroadcastReceiver"\> \<intent-filter\> \<action android:name="android.intent.action.BOOT\_COMPLETED"/\> \</intent-filter\> \</receiver\> \<receiver android:name="com.ansca.corona.notifications.AlarmManagerBroadcastReceiver"/\> \<receiver android:name="com.ansca.corona.notifications.StatusBarBroadcastReceiver"/\> \<receiver android:name="com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"\> \<intent-filter\> \<action android:name="com.google.android.c2dm.intent.RECEIVE"/\> \<action android:name="com.google.android.c2dm.intent.REGISTRATION"/\> \<category android:name="com.iplayalldaystudio.kungfuquest"/\> \</intent-filter\> \</receiver\> \<receiver android:name="com.ansca.corona.purchasing.GoogleStoreBroadcastReceiver"\> \<intent-filter\> \<action android:name="com.android.vending.billing.IN\_APP\_NOTIFY"/\> \<action android:name="com.android.vending.billing.RESPONSE\_CODE"/\> \<action android:name="com.android.vending.billing.PURCHASE\_STATE\_CHANGED"/\> \</intent-filter\> \</receiver\> \</application\> \</manifest\>

Spot anything? The only difference is the <uses-sdk android:minSdkVersion=“8” android:targetSdkVersion=“19”/> is omitted on the Corona Pro build.

Oh another thing that’s different is the package name in the pro-build is still com.ansca.corona while I need to change it cause that’s my package name…

Hmm… come to think of it, how come the Pro build still has the com.ansca.corona as package name ? I noticed alot activities still refer to com.ansca.corona

Ok, I assume that if you have just copied over the manifest changing appropriate stuff, then it’s ok. How about those logs?

I’m quite certain they will tell us the whole story.

Ok, so after going through all the logs I found these weird and error logs from my crashed app. This is the log from the app that works and built using Corona Pro :
 

02-04 06:34:10.658 I/Corona (15930): start google network yoh 02-04 06:34:10.658 V/Corona (15930): \> Class.forName: CoronaProvider.gameNetwork.google.LuaLoader 02-04 06:34:10.666 V/Corona (15930): \< Class.forName: CoronaProvider.gameNetwork.google.LuaLoader 02-04 06:34:10.666 V/Corona (15930): Loading via reflection: CoronaProvider.gameNetwork.google.LuaLoader 02-04 06:34:10.940 E/LockPatternKeyguardView(1713): showAlmostAtAccountLoginDialog()

And this is the log from the crashed app :
First, I noticed this log

02-04 00:07:08.752 V/Corona (9826): \> Class.forName: CoronaProvider.licensing.google.LuaLoader 02-04 00:07:08.752 V/Corona (9826): WARNING: Could not load 'LuaLoader'

and then this is the part when it tried to init google and login :

02-04 00:07:20.994 I/Corona (9826): start google network yoh 02-04 00:07:20.994 V/Corona (9826): \> Class.forName: CoronaProvider.gameNetwork.google.LuaLoader 02-04 00:07:21.080 I/dalvikvm(9826): Could not find method com.google.android.gms.games.GamesClient.loadAchievements, referenced from method CoronaProvider.gameNetwork.google.LuaLoader.request 02-04 00:07:21.080 W/dalvikvm(9826): VFY: unable to resolve virtual method 8791: Lcom/google/android/gms/games/GamesClient;.loadAchievements (Lcom/google/android/gms/games/achievement/OnAchievementsLoadedListener;)V 02-04 00:07:21.080 D/dalvikvm(9826): VFY: replacing opcode 0x6e at 0x03da 02-04 00:07:21.096 D/dalvikvm(9826): VFY: dead code 0x03dd-03de in LCoronaProvider/gameNetwork/google/LuaLoader;.request (Lcom/naef/jnlua/LuaState;)I 02-04 00:07:21.096 V/Corona (9826): \< Class.forName: CoronaProvider.gameNetwork.google.LuaLoader 02-04 00:07:21.104 V/Corona (9826): Loading via reflection: CoronaProvider.gameNetwork.google.LuaLoader 02-04 00:07:21.455 D/dalvikvm(9670): GC\_FOR\_MALLOC freed 8222 objects / 494544 bytes in 264ms 02-04 00:07:21.932 W/dalvikvm(9826): VFY: unable to resolve static field 3035 (common\_google\_play\_services\_unknown\_issue) in Lcom/google/android/gms/R$string; 02-04 00:07:21.932 D/dalvikvm(9826): VFY: replacing opcode 0x60 at 0x003f .......going like this for few lines and then ..... 02-04 00:07:22.080 D/dalvikvm(9826): VFY: dead code 0x000e-0010 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.isGooglePlayServicesAvailable (Landroid/content/Context;)I 02-04 00:07:22.088 E/GooglePlayServicesUtil(9826): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

I’m not sure what to make of this… It seems I miss few libs but I can’t tell which libs to use since I thought I already use the latest and everything…

Could not find method com.google.android.gms.games.GamesClient.loadAchievements, referenced from method CoronaProvider.gameNetwork.google.LuaLoader.request

In my opinion this indicates, that you didn’t include the correct jar file in your project, it looks like a mismatch between corona plugin and GPGS jar.

P.s.

I have found something most irritating in the buildfile for android projects - as part of the build, libs directory are removed.

Make sure, that during build, you use the jar you expect to use.

yeah… i thought so too… but the jars are from what’s inside the enterprise plugin package put inside the project’s libs folder… so it confuses the hell out of me, what else do i need to do?

I really don’t know what to ask anymore… the corona staffs haven’t responded yet :frowning:
 

yanuar, bare with me, I’ll try to create a sample project, maybe from the sample sources, and see what I end up with.

However it will take a moment, I’m in the middle of something.

contact me via email/pm, it will be easier to chat, and we’ll just update the thread with our findings.

cool, I sent you a message since I dont know your email

yanuar,

sorry it took so long.

So I was finally able to create a sample project.

I have used my appid from my old game and its package.

Here are things I did:

I’ve copied google licensing jar from CoronaEnterprise/Plugins/google-licensing/android/bin directory [I wrote it from memory, so YMMV regarding the path ;)]

I’ve copied game network google jars from CoronaEnterprisePlugins package:

CoronaProvider.gameNetwork.google.jar

google-play-services.jar

I have included following entry in my android manifest under application node:

 <meta-data android:name=“com.google.android.gms.games.APP_ID” android:value="\ 123456789"/>

And this is my code from main.lua:

-- hide the status bar display.setStatusBar(display.HiddenStatusBar) local gameNetwork = require "gameNetwork" local showButton = display.newRect(100, 300, 100, 100) showButton:addEventListener("tap", function() &nbsp; &nbsp; gameNetwork.request("login") end) local cache2Button = display.newRect(300, 100, 100, 100) cache2Button:addEventListener("tap", function() &nbsp; &nbsp; gameNetwork.show("leaderboards") end) local show2Button = display.newRect(300, 300, 100, 100) show2Button:addEventListener("tap", function() &nbsp; &nbsp; gameNetwork.show("achievements") end) -- Init game network to use Google Play game services gameNetwork.init("google", function(event) logTable(event) end) &nbsp;

Sorry about code ugliness, I just used this project for testing my own plugins.

Anyway… logTable function pretty prints table to the console, just to check if everything is returned ok.

I first tap on the button with gameNetwork.login function call, I was able to select my account, then I tapped on achievements button and I was able to see my predefined achievements.

I think the problem you have is with the android manifest entry.

You have to remember, that normally, you would define your app id in your resources, and simply link the string in android manifest.

Since now you are specifying it manually straight in xml, you have to make sure it’s a string and not an integer.

In order to do that I used a backslash and space before the ID.

Try that, hopefully this will help.

Let me know how it went.

Krystian

Since now you are specifying it manually straight in xml, you have to make sure it’s a string and not an integer.

In order to do that I used a backslash and space before the ID.

 

Hot diggity! This one did it… thank you so much! I owe you  much beer…

Hmm… if this is the trick then how come the androidmanifest.xml from the Corona Pro build doesn’t use it?

Oh well, doesn’t matter lol

 

Thanks krystian6

yanuar, beer is an accepted currency :slight_smile:

I think CoronaPro does this casting behind the scenes and initiates the game network manually passing the game id, I might be wrong though.

Anyway, I’m happy it all worked out for you :slight_smile:

Hello,

I am having difficulty in getting the SHA1 fingerprint of the certificate. I am following instructions on (https://developers.google.com/games/services/console/enabling) but I am still not being able to get the “c” part (in the link) done i.e, to get the release certificate fingerprint and to get the debug certificate fingerprint. 

Thanks

has anyone solve this? I have the same issue with my enterprise build and it crashes my app

In case of Enterprise, try to include the assets it’s complaining about into your android project directory.

I think it should be easy to find somewhere in the docs of google play what should be included.

I’m on enterprise now, but haven’t migrated games where I use google play services.

The init method works fine but the request(“login”) where it suddenly crash the app. I’ve tried to follow every steps in the docs and also decompile the build made by Corona Pro to see what resources or lines in my androidmanifest are missing.

Still can’t get it to work though… arghhh :frowning:

To Joshua Quick or anyone if you happen to read this :

  • I’m using enterprise 1202 (on graphic 1.0)  but the enterprise plugin is 1260
  • my androidmanifest.xml is pretty much the same with from the corona pro build other than package name is different

Help?
 

yanuar, it’s a shot in the dark, but check your required android version, and whether or not you should include the additional compatibility jar into your project, to make it work on lower versions of android.

I do remember, I had to add this compatibility jar to make my [not corona related] project to work on earlier androids.

Hmm… from the enterprise plugin package, the gameNetwork-google is 1126, so that mean if the latest enterprise with graphic 1.0 is 1202 I should be good right?

I also have used the Froyo google-play-services.jar instead of the original one just in case it’s because the Froyo 2.2 compatibility issue.

In my androidmanifest.xml my minimum sdk is 8 (Froyo)

Latest release with 1.0 is 1260.

If you are building for Froyo you should be fine, I’m not fluent with all the compatibility stuff on Android, but I think that’s for <= API 7.

Anyway, this looks to be something simple & stupid, which in my experience means most difficult to spot :wink:

Is my assumption correct, that when you build using simulator it works fine?

Are you sure all of the permissions are set ok?

Did you include all of the new activities required by GPGS [if there are any]?

Did you setup properly your intents [if it’s required], so GPGS is able to return/start your game?

How about logs? What’s logged when your app crashes?

Don’t limit your adb logcat to grep Corona/pid. Sometimes it’s something else that reports the error.

Hi krystian6, thanks for responding but I’m sure this will

Is my assumption correct, that when you build using simulator it works fine? -> Yup, build using Corona Pro 1225, runs just fine

I’m gonna answer these 3 questions at the same time :

Are you sure all of the permissions are set ok?

Did you include all of the new activities required by GPGS [if there are any]?

Did you setup properly your intents [if it’s required], so GPGS is able to return/start your game?

Yes, I think… as far as I know my androidmanifest.xml is the exact carbon copy (other than the package name) from the androidmanifest.xml that I grab from the apk that I build using simulator.

 

\<?xml version="1.0" encoding="utf-8" standalone="no"?\>\<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="19" android:versionName="1.5" package="com.iplayalldaystudio.kungfuquest"\> \<uses-permission android:name="android.permission.WRITE\_EXTERNAL\_STORAGE"/\> \<uses-permission android:name="android.permission.INTERNET"/\> \<uses-permission android:name="com.android.vending.CHECK\_LICENSE"/\> \<uses-permission android:name="com.android.vending.BILLING"/\> \<uses-feature android:glEsVersion="0x10001"/\> \<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="19"/\> \<uses-feature android:name="android.hardware.telephony" android:required="false"/\> \<uses-feature android:name="android.hardware.screen.portrait" android:required="false"/\> \<uses-feature android:name="android.hardware.screen.landscape" android:required="true"/\> \<application android:hardwareAccelerated="true" android:icon="@drawable/icon" android:label="kqIOS"\> \<meta-data android:name="targetedAppStore" android:value="google"/\> \<meta-data android:name="com.google.android.gms.games.APP\_ID" android:value="219580451XXX"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:label="kqIOS" android:launchMode="singleTask" android:name="com.ansca.corona.CoronaActivity" android:screenOrientation="landscape" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"\> \<meta-data android:name="supportsOrientationPortrait" android:value="false"/\> \<meta-data android:name="supportsOrientationPortraitUpsideDown" android:value="false"/\> \<meta-data android:name="supportsOrientationLandscapeRight" android:value="true"/\> \<meta-data android:name="supportsOrientationLandscapeLeft" android:value="true"/\> \<intent-filter\> \<action android:name="android.intent.action.MAIN"/\> \<category android:name="android.intent.category.LAUNCHER"/\> \</intent-filter\> \</activity\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.ansca.corona.CameraActivity" android:screenOrientation="portrait" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.ansca.corona.VideoActivity" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.ansca.corona.purchasing.StoreActivity" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<activity android:configChanges="keyboardHidden|orientation|screenSize" android:name="com.facebook.LoginActivity" android:theme="@\*android:style/Theme.NoTitleBar.Fullscreen"/\> \<service android:name="com.ansca.corona.CoronaService"/\> \<receiver android:name="com.ansca.corona.SystemStartupBroadcastReceiver"\> \<intent-filter\> \<action android:name="android.intent.action.BOOT\_COMPLETED"/\> \</intent-filter\> \</receiver\> \<receiver android:name="com.ansca.corona.notifications.AlarmManagerBroadcastReceiver"/\> \<receiver android:name="com.ansca.corona.notifications.StatusBarBroadcastReceiver"/\> \<receiver android:name="com.ansca.corona.notifications.GoogleCloudMessagingBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND"\> \<intent-filter\> \<action android:name="com.google.android.c2dm.intent.RECEIVE"/\> \<action android:name="com.google.android.c2dm.intent.REGISTRATION"/\> \<category android:name="com.iplayalldaystudio.kungfuquest"/\> \</intent-filter\> \</receiver\> \<receiver android:name="com.ansca.corona.purchasing.GoogleStoreBroadcastReceiver"\> \<intent-filter\> \<action android:name="com.android.vending.billing.IN\_APP\_NOTIFY"/\> \<action android:name="com.android.vending.billing.RESPONSE\_CODE"/\> \<action android:name="com.android.vending.billing.PURCHASE\_STATE\_CHANGED"/\> \</intent-filter\> \</receiver\> \</application\> \</manifest\>

Spot anything? The only difference is the <uses-sdk android:minSdkVersion=“8” android:targetSdkVersion=“19”/> is omitted on the Corona Pro build.

Oh another thing that’s different is the package name in the pro-build is still com.ansca.corona while I need to change it cause that’s my package name…

Hmm… come to think of it, how come the Pro build still has the com.ansca.corona as package name ? I noticed alot activities still refer to com.ansca.corona

Ok, I assume that if you have just copied over the manifest changing appropriate stuff, then it’s ok. How about those logs?

I’m quite certain they will tell us the whole story.