[Resolved] GPGS: gameNetwork.init does nothing... with an error: Google Play services resources not found

Naomi,

Make sure you read to the bottom of my post on what I found about the “Google Play Resources Not Found” message, it is a false positive with the gpsu class file and has nothing to do with what you are currently trying to do so just ignore that and focus on getting everything hooked up and working (and “always” make sure you uninstall your app before testing) until such time that you have it actually connecting to the network.

“First and foremost you can ignore the Google Play Resources Not Found message it is a false positive and is being caused by com.google.android.gms.common.GooglePlayServicesUtil.class which is a error in google itself and has nothing to do with corona and will not stop you from proceeding with GPGS so don’t worry about that just make sure it tests and works correctly the rest can be ignored.”

Christopher

Christopher, thank you so much.

I followed your instruction (steps 1 through 6)  carefully, and the changes I made to the sample project are:

  1.  In build.settings, I changed GPGS_ID to that of my app and commented out versionCode & versionName (I add them when I build APK).

  2.  In config.lua, I added the key and commented out the notification block (because I haven’t set things up for notification with my project.)

  3.  In main.lua, I changed line 7 where I added my leaderboard ID, then changed line 119 where I added my achievement ID.

  4.  Renamed the folder to the name of my app.

I built the APK using the keystore and package name that match properly.

I uninstalled my app from my test device and then installed the new APK.

And it still gives me the very same error when I launch the app.  See the second to last line (in bold letters) in the LAUNCH LOG below.  Next, I cleared the log and tapped on Login button, and it gave me fatal error.  See the LOGIN LOG.  I haven’t read your code, so I don’t know why I get fatal error while you don’t.  Perhaps there are some other items that need modification so that the sample project would work with my keystore, package name and Googe Play Console setup?

At this point, I’m wondering if the alpha APK already uploaded to Google Play (even though it is not published) can have some effect when testing locally?  Perhaps alpha APK is faulty (because it was just a placeholder for me), and that’s the root of all problem?  I don’t know.  Just a wild guess and probably not the case, but I’m too bewildered…

Naomi

Edit:  WAIT.  IT SAYS “Application ID (GPGS_ID) must be a numeric value” in LOGIN LOG.  Let me check.  And, OMG, I didn’t save the build.settings file before building the APK (how embarrassing).  Let me post back as soon as I test this thing.

And it WORKED!

Christopher, tapping on your Login button brought up the GPGS’s login thing, instead of failing.

I still get “The Google Play services resources were not found” error upon launch, but it doesn’t seem to cause login issue.  It brings up popup window, showing my pix and the app’s icon, saying myapp would like to: know my basic profile info, etc.

Now that I know Google Play side of settings are working, I’ll look at your sample code and work out how mine should be.

Thanks again!

Naomi

----------- LAUNCH LOG -----------

D/dalvikvm(  687): GC_CONCURRENT freed 3615K, 28% free 12034K/16524K, paused 7ms+5ms, total 53ms

D/dalvikvm(  687): GC_FOR_ALLOC freed 687K, 24% free 12719K/16524K, paused 38ms, total 47ms

D/dalvikvm( 7148): GC_CONCURRENT freed 167K, 6% free 8495K/9008K, paused 2ms+3ms, total 25ms

D/Finsky  ( 7148): [1] 5.onFinished: Installation state replication succeeded.

I/ActivityManager(  442): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.mycompany.myapp/com.ansca.corona.CoronaActivity} from pid 687

D/dalvikvm(  442): JIT code cache reset in 3 ms (1048552 bytes 2/0)

D/dalvikvm(  442): GC_FOR_ALLOC freed 327K, 18% free 15609K/18820K, paused 63ms, total 65ms

D/dalvikvm(  442): GC_FOR_ALLOC freed 499K, 19% free 15356K/18820K, paused 56ms, total 56ms

I/ActivityManager(  442): Start proc com.mycompany.myapp for activity com.mycompany.myapp/com.ansca.corona.CoronaActivity: pid=7340 uid=10027 gids={50027, 3003, 1028}

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/liblua.so 0x42120408

D/dalvikvm( 7340): Added shared lib /data/app-lib/com.mycompany.myapp-1/liblua.so 0x42120408

D/dalvikvm( 7340): No JNI_OnLoad found in /data/app-lib/com.mycompany.myapp-1/liblua.so 0x42120408, skipping init

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/libjnlua5.1.so 0x42120408

D/dalvikvm( 7340): Added shared lib /data/app-lib/com.mycompany.myapp-1/libjnlua5.1.so 0x42120408

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/libjnlua5.1.so 0x42120408

D/dalvikvm( 7340): Shared lib ‘/data/app-lib/com.mycompany.myapp-1/libjnlua5.1.so’ already loaded in same CL 0x42120408

I/dalvikvm( 7340): threadid=1: recursive native library load attempt (/data/app-lib/com.mycompany.myapp-1/libjnlua5.1.so)

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/libopenal.so 0x42120408

I/OpenAL_SLES( 7340): alc_opensles_init

D/dalvikvm( 7340): Added shared lib /data/app-lib/com.mycompany.myapp-1/libopenal.so 0x42120408

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/libmpg123.so 0x42120408

D/dalvikvm( 7340): Added shared lib /data/app-lib/com.mycompany.myapp-1/libmpg123.so 0x42120408

D/dalvikvm( 7340): No JNI_OnLoad found in /data/app-lib/com.mycompany.myapp-1/libmpg123.so 0x42120408, skipping init

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/libalmixer.so 0x42120408

D/dalvikvm( 7340): Added shared lib /data/app-lib/com.mycompany.myapp-1/libalmixer.so 0x42120408

D/dalvikvm( 7340): No JNI_OnLoad found in /data/app-lib/com.mycompany.myapp-1/libalmixer.so 0x42120408, skipping init

D/dalvikvm( 7340): Trying to load lib /data/app-lib/com.mycompany.myapp-1/libcorona.so 0x42120408

D/dalvikvm( 7340): Added shared lib /data/app-lib/com.mycompany.myapp-1/libcorona.so 0x42120408

D/dalvikvm( 7340): GC_CONCURRENT freed 165K, 3% free 7766K/7996K, paused 6ms+11ms, total 69ms

D/libEGL  ( 7340): loaded /system/lib/egl/libEGL_tegra.so

D/libEGL  ( 7340): loaded /system/lib/egl/libGLESv1_CM_tegra.so

D/libEGL  ( 7340): loaded /system/lib/egl/libGLESv2_tegra.so

D/OpenGLRenderer( 7340): Enabling debug mode 0

D/dalvikvm( 7340): Note: class Landroid/opengl/GLWrapperBase; has 250 unimplemented (abstract) methods

V/GLSurfaceView( 7340): glGetString(7937) returns NVIDIA Tegra 3;

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

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

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

I/Corona  ( 7340): Platform: Nexus 7 / ARM Neon / 4.3 / NVIDIA Tegra 3 / OpenGL ES 2.0 14.01003 / 2014.2381

V/Corona  ( 7340): > Class.forName: CoronaProvider.licensing.google.LuaLoader

V/Corona  ( 7340): < Class.forName: CoronaProvider.licensing.google.LuaLoader

I/ActivityManager(  442): Displayed com.mycompany.myapp/com.ansca.corona.CoronaActivity: +658ms

V/Corona  ( 7340): Loading via reflection: CoronaProvider.licensing.google.LuaLoader

D/dalvikvm( 7340): GC_CONCURRENT freed 422K, 6% free 7775K/8260K, paused 10ms+9ms, total 54ms

V/Corona  ( 7340): > Class.forName: CoronaProvider.gameNetwork.google.LuaLoader

V/Corona  ( 7340): < Class.forName: CoronaProvider.gameNetwork.google.LuaLoader

V/Corona  ( 7340): Loading via reflection: CoronaProvider.gameNetwork.google.LuaLoader

W/dalvikvm( 7340): VFY: unable to resolve static field 4851 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0041

W/dalvikvm( 7340): VFY: unable to resolve static field 4847 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x004c

W/dalvikvm( 7340): VFY: unable to resolve static field 4857 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0057

W/dalvikvm( 7340): VFY: unable to resolve static field 4854 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0069

W/dalvikvm( 7340): VFY: unable to resolve static field 4848 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0009

W/dalvikvm( 7340): VFY: unable to resolve static field 4845 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0010

W/dalvikvm( 7340): VFY: unable to resolve static field 4855 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0017

W/dalvikvm( 7340): VFY: unable to resolve static field 4852 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x0004

W/dalvikvm( 7340): VFY: unable to resolve static field 4852 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;

D/dalvikvm( 7340): VFY: replacing opcode 0x60 at 0x000c

I/dalvikvm( 7340): DexOpt: unable to optimize static field ref 0x12f2 at 0x18 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b

I/dalvikvm( 7340): DexOpt: unable to optimize static field ref 0x12f1 at 0x38 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b

I/dalvikvm( 7340): DexOpt: unable to optimize static field ref 0x12ee at 0x3f in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b

I/dalvikvm( 7340): DexOpt: unable to optimize static field ref 0x12f8 at 0x46 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b

I/dalvikvm( 7340): DexOpt: unable to optimize static field ref 0x12f5 at 0x66 in Lcom/google/android/gms/common/GooglePlayServicesUtil;.b

E/GooglePlayServicesUtil( 7340): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

D/dalvikvm( 7340): GC_CONCURRENT freed 342K, 6% free 7818K/8260K, paused 5ms+1ms, total 32ms

----------- END -----------

----------- LOGIN LOG -----------

D/BaseGameActivity( 7340): onCreate: creating GamesClient

E/GooglePlayServicesUtil( 7340): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

D/BaseGameActivity( 7340): isGooglePlayServicesAvailable returned 0

D/BaseGameActivity( 7340): beginUserInitiatedSignIn: starting new sign-in flow.

D/BaseGameActivity( 7340): Connecting GamesClient.

E/GooglePlayServicesUtil( 7340): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

D/BaseGameActivity( 7340): onConnectionFailed: result 4

D/BaseGameActivity( 7340): onConnectionFailed: since user initiated sign-in, trying to resolve problem.

D/BaseGameActivity( 7340): resolveConnectionResult: trying to resolve result: ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{421aa040: android.os.BinderProxy@421a8858}}

D/BaseGameActivity( 7340): result has resolution. Starting it.

I/ActivityManager(  442): START u0 {flg=0x4000000 cmp=com.google.android.gms/.games.ui.signin.SignInActivity (has extras)} from pid -1

D/dalvikvm(  442): GC_FOR_ALLOC freed 933K, 19% free 15387K/18820K, paused 58ms, total 61ms

I/ActivityManager(  442): Start proc com.google.android.gms.ui for activity com.google.android.gms/.games.ui.signin.SignInActivity: pid=7436 uid=10017 gids={50017, 3003, 1007, 1028, 1015, 1006, 3002, 3001, 2001, 3006}

I/MultiDex( 7436): install

I/MultiDex( 7436): MultiDexExtractor.load(/data/app/com.google.android.gms-2.apk, false)

I/MultiDex( 7436): loading existing secondary dex files

I/MultiDex( 7436): load found 1 secondary dex files

I/MultiDex( 7436): install done

I/ProviderInstaller( 7436): Insert disabled by gate ‘gms:security:enable_conscrypt_in_gms_application’

D/GCM     (  747): GcmService start Intent { act=com.google.android.gms.INITIALIZE flg=0x10 pkg=com.google.android.gms cmp=com.google.android.gms/.gcm.GcmService } com.google.android.gms.INITIALIZE

I/dalvikvm( 7436): Could not find method android.app.AppOpsManager.checkPackage, referenced from method cbf.a

W/dalvikvm( 7436): VFY: unable to resolve virtual method 1279: Landroid/app/AppOpsManager;.checkPackage (ILjava/lang/String;)V

D/dalvikvm( 7436): VFY: replacing opcode 0x6e at 0x0010

D/libEGL  ( 7436): loaded /system/lib/egl/libEGL_tegra.so

D/libEGL  ( 7436): loaded /system/lib/egl/libGLESv1_CM_tegra.so

D/libEGL  ( 7436): loaded /system/lib/egl/libGLESv2_tegra.so

D/OpenGLRenderer( 7436): Enabling debug mode 0

D/dalvikvm( 7436): GC_CONCURRENT freed 266K, 5% free 7717K/8048K, paused 3ms+8ms, total 25ms

W/InputMethodManager( 7436): Ignoring onBind: cur seq=76, given seq=75

I/ActivityManager(  442): Displayed com.google.android.gms/.games.ui.signin.SignInActivity: +476ms

E/ViewRootImpl( 7436): Attempting to destroy the window while drawing!

E/ViewRootImpl( 7436):   window=android.view.ViewRootImpl@42182ee8, title=

I/ActivityManager(  442): START u0 {act=com.google.android.gms.common.account.CHOOSE_ACCOUNT flg=0x20000000 pkg=com.google.android.gms cmp=com.google.android.gms/.common.account.AccountPickerActivity (has extras)} from pid 7436

D/dalvikvm(  442): GC_FOR_ALLOC freed 586K, 19% free 15390K/18820K, paused 69ms, total 70ms

D/dalvikvm(  442): GC_FOR_ALLOC freed 507K, 19% free 15373K/18820K, paused 62ms, total 62ms

D/dalvikvm( 7436): GC_CONCURRENT freed 208K, 4% free 7987K/8288K, paused 2ms+3ms, total 21ms

I/ActivityManager(  442): Displayed com.google.android.gms/.common.account.AccountPickerActivity: +207ms

----------- END -----------

Yeah ignore the google error it means nothing and imagine google will fix it in next ask update :slight_smile:

Hopefully I made the sample close to what your are doing so should be easy to find and resolve but was still sleeping when I write it lol

Yes, thank you, Christopher.

My Login button was calling gameNetwork.init( “google”, initCallback ), and then only when there was no error (i.e., only when event.isError wasn’t true), it was going to call gameNetwork.request(“login”, { userInitiated = true, listener = loadLocalUser }).

However, with yours, even when the login fails at launch, you go ahead and request login.

That was the difference.

I changed my test project (which I posted earlier in page 1) so that tapping on Sign In won’t call gameNetwork.init but instead call gameNetwork.request for login.  And it worked just like yours.

Edit:  I thought about it – and I guess I was mistaken to think init failed.  Login failed at launch because it was not userInitiated.  But I simply thought init failed because of the “Google Play services resources not found” error.  Ugh. 

Naomi

Yeah, with the exception of Apple which you need to call gamNetwork.init on application start (as they shut it down) you need to call .init for google when you app launches. 

The gameNetwork.request for login returns “nil” if successful and false if there is an actual error which was confusing for me as I expect it to return true if everything worked lol…

This isn’t so much an error with corona as it is an error with the “plugin” that you are using for google network.

I am glad you got everything sorted out, I was actually going to write conditional statements for apple/google as there is a difference on how you call things but wasn’t sure if you were using game center.

Thank you, Christopher.  Your explanation makes sense.  

Really good to know what to expect from gameNetwork.request – definitely will help me coding this thing right.

Thanks again!!

Naomi

No problem :) 

Since this thread became a two-page thing before the issue was sorted, I added the solution in the first post that started this thread (so that, in case someone stumbles across this thing, it’s easier to get to the bottom of it right away.)

Cheers,

Naomi