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

RESOLVED.

In a nutshell, this frustrating problem was caused by the following:

  1.  gameNetwork.init at launch automatically outputs “Google Play services resources not found” error on terminal (even when there are no such error).  This error must be ignored and not to be dealt with.

  2.  gameNetwork.init returns event.isError only.  Unlike iOS version, it does not return event.data – so not calling login request until event.data is returned resulted in gameNetwork.init to do nothing.

In hindsight, I probably would not have spent so many days sorting this out if I knew “resources not found” error should’ve been simply ignored.  I was chasing after a false trail the entire time, fiddling and fiddling and fiddling forever with Google Play Dev Console…  If only I looked for the problem elsewhere sooner…

Thank you, Christopher and Rob, for being there for me.

Naomi


Original Post


I’m using latest public release (2014.2381), and testing on Nexus 7 (with Android 4.3 Jelly Bean).

I’m working on adding Leaderboard and Achievement along with in-app billing to my latest game app, but I’m unable to get the gameNetwork.init to do anything.

I believe I set up my build.settings and config.lua correctly.  I also believe I added my game to Google Developer Console properly (including Game Services, linking to the game, authorizing the linked game, adding test users, etc.)

However, gameNetwork.init just doesn’t do anything.  

I mean, I call gameNetwork.init( “google”, initCallback ) in main.lua, and it fails with event.isError.  The logcat says “onConnectionFailed: since user didn’t initiate sign-in, failing now.”

I then go on to my game’s GPGS sign-in screen, and tap on “Sign In”, which calls gameNetwork.init( “google”, initCallback ) again.  Then my app waits for initCallback for a response, but none comes.  It doesn’t even respond with event.isError – it simply waits and waits (and the device falls asleep.)

I can ignore this waiting part –  meaning, without waiting for the response, I can exit the GPGS sign-in screen and start playing my game without any problems.  So when I call gameNetwork.init in GPGS sign-in screen, it’s as if it doesn’t do anything.

Looking at logcat, I see there are some problems (I’ve posted the relevant log and full log below).

Any ideas on how to deal with this problem?  I’d so appreciate any and all help.

Naomi

--------- RELEVANT ERROR LOG ----------

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

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

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

D/BaseGameActivity( 6161): onCreate: creating GamesClient

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

D/BaseGameActivity( 6161): onConnectionFailed: result 4

D/BaseGameActivity( 6161): onConnectionFailed: since user didn’t initiate sign-in, failing now.

I/Corona  ( 6161): -------------- Google Play Game Services initCallback failed -------------

I/Corona  ( 6161): event.isError = true

-------- FULL LOG --------

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

D/dalvikvm(  443): GC_FOR_ALLOC freed 957K, 24% free 15322K/19928K, paused 54ms, total 56ms

I/ActivityManager(  443): Start proc com.mycompany.myapp for activity com.mycompany.myapp/com.ansca.corona.CoronaActivity: pid=6161 uid=10072 gids={50072, 3003, 1015, 1028}

I/ActivityThread( 6161): Pub com.mycompany.myapp.files: com.ansca.corona.storage.FileContentProvider

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

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

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

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

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

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

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

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

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

I/OpenAL_SLES( 6161): alc_opensles_init

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

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

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

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

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

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

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

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

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

D/dalvikvm( 6161): GC_CONCURRENT freed 158K, 4% free 7608K/7920K, paused 6ms+12ms, total 71ms

D/dalvikvm( 6161): GC_CONCURRENT freed 91K, 3% free 8015K/8260K, paused 11ms+17ms, total 75ms

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

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

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

D/OpenGLRenderer( 6161): Enabling debug mode 0

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

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

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

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

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

I/Corona  ( 6161): Platform: Nexus 7 / ARM Neon / 4.2 / NVIDIA Tegra 3 / OpenGL ES 2.0 14.01002 / 2014.2381

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

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

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

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

D/dalvikvm( 6161): GC_FOR_ALLOC freed 370K, 7% free 7945K/8468K, paused 30ms, total 31ms

I/dalvikvm-heap( 6161): Grow heap (frag case) to 11.811MB for 4096016-byte allocation

D/dalvikvm( 6161): GC_FOR_ALLOC freed <1K, 5% free 11944K/12472K, paused 39ms, total 39ms

D/dalvikvm( 6161): GC_CONCURRENT freed 4K, 5% free 11944K/12472K, paused 2ms+2ms, total 71ms

I/SoundDecoder( 6161): ALL MPG123 DECODERS:

I/SoundDecoder( 6161):  generic

I/SoundDecoder( 6161): 

I/SoundDecoder( 6161): SUPPORTED MPG123 DECODERS:

I/SoundDecoder( 6161):  generic

I/SoundDecoder( 6161): 

I/OpenAL_SLES( 6161): opensles_open_playback pDevice=0x674a8008, deviceName=(null)

I/OpenAL_SLES( 6161): alc_opensles_probe DEVICE_PROBE

I/OpenAL_SLES( 6161): opensles_reset_playback pDevice=0x674a8008

I/OpenAL_SLES( 6161): bits=16, channels=2, samples=1024, size=4096, freq=44100

I/OpenAL_SLES( 6161): create audio player

W/libc    ( 6161): pthread_create sched_setscheduler call failed: Operation not permitted

I/OpenAL_SLES( 6161): playback_function started

I/OpenAL  ( 6161): _SC_NPROCESSORS_ONLN=4

I/SoundDecoder( 6161): OGG: bitstream version == (0).

I/SoundDecoder( 6161): OGG: bitstream channels == (1).

I/SoundDecoder( 6161): OGG: bitstream sampling rate == (44100).

I/SoundDecoder( 6161): OGG: seekable == {TRUE}.

I/SoundDecoder( 6161): OGG: number of logical bitstreams == (1).

I/SoundDecoder( 6161): OGG: serial number == (951740170).

I/SoundDecoder( 6161): OGG: total seconds of sample == (0.000000).

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

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

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

V/Corona  ( 6161): > Class.forName: CoronaProvider.ads.vungle.LuaLoader

V/Corona  ( 6161): < Class.forName: CoronaProvider.ads.vungle.LuaLoader

V/Corona  ( 6161): Loading via reflection: CoronaProvider.ads.vungle.LuaLoader

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x004b

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0056

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0061

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0073

W/dalvikvm( 6161): VFY: unable to resolve static field 5067 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0085

W/dalvikvm( 6161): VFY: unable to resolve static field 5065 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x00af

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x00ce

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x000f

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0016

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x001d

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

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0007

W/dalvikvm( 6161): VFY: unable to resolve static field 5062 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0018

W/dalvikvm( 6161): VFY: unable to resolve static field 5061 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0038

W/dalvikvm( 6161): VFY: unable to resolve static field 5058 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x003f

W/dalvikvm( 6161): VFY: unable to resolve static field 5073 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0046

W/dalvikvm( 6161): VFY: unable to resolve static field 5070 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0066

W/dalvikvm( 6161): VFY: unable to resolve static field 5066 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x006d

W/dalvikvm( 6161): VFY: unable to resolve static field 5064 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x0074

W/dalvikvm( 6161): VFY: unable to resolve static field 5069 (common_google_play_services_unsupported_date_text) in Lcom/google/android/gms/R$string;

D/dalvikvm( 6161): VFY: replacing opcode 0x60 at 0x007b

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

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

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

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

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

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

I/Corona  ( 6161): ---------- inside google initCallback -------------

I/Corona  ( 6161): ----------starting Google login -------------

D/BaseGameActivity( 6161): onCreate: creating GamesClient

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

D/BaseGameActivity( 6161): onConnectionFailed: result 4

D/BaseGameActivity( 6161): onConnectionFailed: since user didn’t initiate sign-in, failing now.

I/Corona  ( 6161): -------------- Google Play Game Services initCallback failed -------------

I/Corona  ( 6161): event.isError = true

D/dalvikvm(  991): GC_CONCURRENT freed 1097K, 11% free 10793K/12044K, paused 3ms+4ms, total 61ms

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

D/dalvikvm( 6161): GC_CONCURRENT freed 5022K, 39% free 8435K/13608K, paused 3ms+4ms, total 38ms

D/dalvikvm( 6161): GC_CONCURRENT freed 414K, 38% free 8481K/13608K, paused 3ms+3ms, total 29ms

D/dalvikvm( 6161): GC_CONCURRENT freed 357K, 38% free 8511K/13608K, paused 4ms+3ms, total 35ms

I/PowerManagerService(  443): Going to sleep by user request…

-------- END OF FULL LOG --------

Hey Naomi.  I’m actually working on adding GPGS to a game of mine right now and I’m getting logged in, though I’m hitting an issue that I don’t have my achievements and leaderboards in yet.

Did you generate your SHA1 key correctly?

Rob

Just as an FYI I just successfully logged in and got the loadLocalPlayer request and got the data back.

Rob

Hi Rob, thank you for your replies.  

I’ve generated SHA1 key correctly, and I have client ID for my app’s project under the “credentials” section here:   https://console.developers.google.com/project

I set up 5 achievements and 4 leaderboards this morning.

I also went ahead and published the game services for this game.  I then published the alpha version of the game.

When this didn’t help, I generated a new APK and uploaded it to alpha, and published it too.

What else can I be missing?  And why don’t I get event.isError when I call gameNetwork.init the second time?

I’m at my wits end… Can it be that I just need to wait a day before it starts working?  Did you set up game services today and it simply worked for you?

Naomi

BTW, under the credentials section of developer console ( https://console.developers.google.com/project ), it shows that DEEP LINKING is disabled.

Is it supposed to be enabled?

Naomi

Edit:  Nah, DEEP LINKING is disabled in all of my other apps that have GPGS (including leaderboards, achievement & multiplayer game mode.)  So this isn’t it.

I just don’t know how to fix this problem… because I really don’t know what is causing the problem.

I’m also wondering if I need to download the alpha version of the game from Google Play as a test user before I can test GPGS?  I uploaded the APK (along with its expansion file), but I have not downloaded it from the Play Store.  Instead, I side loaded the game.

Can it be causing the problem?

Naomi

Naomi,

I just implemented GPGS yesterday and ran into the same problem but was pretty simple to fix (at least in my case).

You don’t even need to publish an alpha build of your app or publish your GPGS data to get it working, just have your app ready to publish and by that I mean add some dummy store data, and upload your apk from that point when you run through the wizard and put in the product id of your app it should pick up the rest of the info for you and link the two.

First things first is to go to the developer console (API) (https://code.google.com/apis/console) and make sure you have Google Play Game Services and Google Play Game Management turned on which seems fairly obvious lol

I just created a test for GPGS and wrote down the steps I took and everything worked with zero issues.

1:  Create a new application in Google Developer (just store listing not APK) – (just add dummy info for desc and hit save)

2: Click on services and APIs and grab the license key and put it in the config.lua file (application->license section)

3: Compile my APK and upload it (don’t publish just save)

4: Click on Game Services and Add New Game

5: Use “I don’t use any google apis in my game yet” and fill in the name and category.

6: Follow the wizard and clicking next etc.

7: Make sure you put in the product id (com.yourapp.game) of your build when asked.

8: IGNORE the SHA stuff it will auto-add it for you (at least that has been my experience) and continue.

9: Take the number it gives you (which should say something like this is the only number you need)

10: Add that number to your build.settings file for googlePlayGamesAppId in the android section.

11: Add 5 achievements and 1 leaderboard.

12: In testing (Game Services->Game Item->Testing) add the gmail account of the “logged in” account of your android device (doesn’t need to be in alpha or beta).

12: add the codes to the lua note: I add to google first so i can use the same ID on apple.

local leaderID = "CgkI7Lva9bAbEAIQBg" local achievementID = { {key = "A1", id = "CgkI7Lva9bAbEAIQAQ"}, {key = "A2", id = "CgkI7Lva9bAbEAIQAg"}, {key = "A3", id = "CgkI7Lva9bAbEAIQAw"}, {key = "A4", id = "CgkI7Lva9bAbEAIQBA"}, {key = "A5", id = "CgkI7Lva9bAbEAIQBQ"}, }

13: Add this (USE::userInitiated = true) NOT FALSE -> using false made everything fail on my side (just a side note))

 gameNetwork = require "gameNetwork" gameNetwork.init("google") gameNetwork.request("login",{userInitiated = true}) 

14: Test with

--Show Leaderboards timer.peformWithDelay(1000, function() gameNetwork.show("leaderboards") end, 1) --Show Achievements timer.peformWithDelay(1000, function() gameNetwork.show("achievements") end, 1) --Unlock Achievement timer.peformWithDelay(1000, function() gameNetwork.request("unlockAchievement", {achievement = {identifier = achievementID["A1"].id}}) end, 1)

If you use USB debugging on your android like me.

14: plug in your device to your computer
15: Rebuild and push to your device with adb -d install -r “C:\path\mygame.apk”

16: run adb logcat

17: run your game and see what is going on :slight_smile:

18: everything works fine :slight_smile:

Not sure if that helps but those are the steps I just did on a brand new project in corona.

Christopher, thank you for the detailed steps you took to successfully implement leaderboard and achievements.

I think I covered all of the steps you described, except for the Step 8 related to SHA1.  I’m wondering why pre-filled SHA1 worked for you.  I’ve had SHA1 issue with one of my already released game, and the problem was due to simply accepting the pre-filled SHA1 at that time.  

I had exchanged emails with Google person when this SHA1 caused me headache – I wonder if they fixed it so that their system can automatically retrieve correct SHA1 now?  But then it feels odd, because the password is required for the keystore before the SHA1 can be retrieved, and unless you supply it, how can Google Play Developer Console know what might be the correct SHA1 for the uniqe keystore we use for each of our app/game?

Anyhow, I made sure to confirm/retrieve SHA1 using terminal with the following command:

keytool -exportcert -alias myappalias -keystore myapp.keystore -list -v

where myapp would be replaced with the name of my app.

Regardless, I really appreciate you providing the full, detailed steps.  I’m sure a lot of devs on this Forum would appreciate it.

And I totally appreciate you letting me know that it really isn’t necessary to publish the app or publish the game services before the testing can be done.

So now, I can eliminate published / not-published from potential list of reasons why it isn’t working for me.

Here’s what I do in my main.lua:

[lua]

– require gameNetwork

local gameNetwork = require( “gameNetwork” )

– later on

local function loadLocalUser( event )

     print("---------- inside google loadLocalUser ----------")

     if event.isError then

          print("event.isError = " … tostring(event.isError))

    elseif (event.data) then

        print("---------- login successful ----------") 

    end

end

local function initCallback( event )

     if event.isError then

          print("event.isError = " … tostring(event.isError))

    elseif event.data then

        print("---------- starting Google login ----------")

        gameNetwork.request(“login”, { userInitiated = false, listener = loadLocalUser })

    end

end

print("------- calling gameNetwork.init ---------")

gameNetwork.init( “google”, initCallback )

[/lua]

And here’s the terminal output relevant to the above:

I/Corona  ( 4249): ---------- calling gameNetwork.init ----------

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

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

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

I/Corona  ( 4249): ---------- inside google initCallback ----------

I/Corona  ( 4249): ---------- starting Google login ----------

D/BaseGameActivity( 4249): onCreate: creating GamesClient

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

D/BaseGameActivity( 4249): onConnectionFailed: result 4

D/BaseGameActivity( 4249): onConnectionFailed: since user didn’t initiate sign-in, failing now.

I/Corona  ( 4249): ---------- inside google loadLocalUser ----------

I/Corona  ( 4249): event.isError = true

------------------------------ End of Terminal Output ------------------------------

Once my game comes to my home screen, I go to GPGS sign-in scene where I have:

[lua]

– require gameNetwork

local gameNetwork = require( “gameNetwork” )

– later on

local function loadLocalUser( event )

     print("---------- inside google loadLocalUser ----------")

     if event.isError then

          print("event.isError = " … tostring(event.isError))

     elseif then

          print("---------- login successful ----------")

     end

end

local function initCallback( event )

     if event.isError then

          print("event.isError = " … tostring(event.isError))

     elseif event.data then

          print("---------- starting Google login ----------")

          gameNetwork.request(“login”, { userInitiated = true, listener = loadLocalUser })

     end

end

print("------- calling gameNetwork.init ---------")

gameNetwork.init( “google”, initCallback )

[/lua]

And here’s the terminal output from this scene when I tap on “Sign In” button:

I/Corona  ( 4249): ---------- calling gameNetwork.init ----------

I get nothing else.

I can return back to my home screen, then go to game play screen, and play the game.  I can pretty much do everything else the my game app allows for (except for in-app billing which I haven’t tested yet – I figure I should get the GPGS working first.)  So it’s as if gameNetwork.init is never called the second time.

How am I suppose to debug this thing…?

Naomi

Naomi,

Ahhhhh, the famous “The Google Play services resources were not found” error I battled with this for about two days before figuring out what the deal was and haven’t had it since lol… 

I won’t be back at my dev machine until tomorrow but will pull up the code and the notes that I found to resolve it, it had nothing to do with SHA etc. and will post once I get the code maybe that will resolve your issue.

Regarding SHA I am not sure if they fixed it or not as it wasn’t until two weeks ago that I decided to try the game network but it seems to read it from my current keystore so haven’t bothered to look into it further just hit the next button and get the id back from google lol…

Christopher

Christopher,

That is so reassuring.  I look forward to hearing how you resolved this thing.  I’m at my wits end.

Naomi

Naomi, are you using:

adb logcat

or

adb logcat Corona:v \*:s

???  The second form only shows messages from your Corona Activity and you won’t get messages from other apps like Google Play.   Of course this means you get every thing making it harder to find the messages, but you might be missing some messages that could help.

I did not have to publish my app, though I did.  I did not have to publish the GPGS service.  As soon as I had all green check marks, it started working.

Rob

Rob, I’m using adb logcat.

If I do adb logcat Corona:v *:s , I believe I would only see output that starts with …/Corona and nothing else.

Thank you so much for thinking about this.

Naomi

P.S., I got all green check marks, and I published it – even then, it fails in main.lua and nothing happens in GPGS sign-in screen…

Is it trying to login?  Do you get a popup from Google Play?

No, I don’t get anything.  

In main.lua, it silently fails (with event.isError = true), and in GPGS sign-in screen, nothing happens – I don’t even get event.isError returned.

Naomi

I’m confused.  You say you don’t get any thing, but then you say you get the GPGS sign in screen. 

Rob

Hi Rob, I was away and didn’t see your reply post until now.  And I’m sorry about the confusion.  

When I mentioned “GPGS sign in screen”, I meant a scene I added (say, myGPGS.lua scene).  I should’ve said “GPGS sign in scene” to be a little clearer…

Anyhow, on this scene, I have three buttons:

  1.  Leaderboard

  2.  Achievement

  3.  Sign in

What it does when I tap on “Sign in” button is to fire gameNetwork.init( “google”, initCallback ).  And here is the relevant set of code:

[lua]

– require gameNetwork

local gameNetwork = require( “gameNetwork” )

– later on

local function loadLocalUser( event )

     print("---------- inside google loadLocalUser ----------")

     if event.isError then

          print("event.isError = " … tostring(event.isError))

     elseif then

          print("---------- login successful ----------")

     end

end

local function initCallback( event )

     if event.isError then

          print("event.isError = " … tostring(event.isError))

     elseif event.data then

          print("---------- starting Google login ----------")

          gameNetwork.request(“login”, { userInitiated = true, listener = loadLocalUser })

     end

end

print("------- calling gameNetwork.init ---------")

gameNetwork.init( “google”, initCallback )

[/lua]

When I tap on “Sign in” button, all I see on terminal (with  adb logcat ) is the “------- calling gameNetwork.init ---------” and nothing else.  

I can keep tapping this “Sign in” button, and it simply spits out “------- calling gameNetwork.init ---------” over and over and nothing else.

Naomi

So, out of desperation, I created an entirely new keystore with new package name, and took every single step that Christopher noted above.  Yes, everything look good.  All green and ready to publish.

I even commented out ads that require game service.

But I still get the dreadful “The Google Play services resources were not found” error.

Anyone with any clue why this is happening?

Naomi

P.S.  On the side note, SHA1 thing was amazing.  I retrieved the SHA1 using terminal command ahead of time, and then when I went on to authorize the app, the SHA1 that Google Play pre-filled matched exactly that of what I retrieved earlier.  So Google engineers did fix the bug so that there are one less thing that could cause us grief along the way.

P.P.S.  Next up is putting together a very simple app that just signs in to GPGS and do nothing else.  If it works (and I hope it does work), then I’ll go back to my game code and figure out where things went wrong…

Hi Naomi.

Your code looks like it should work.  I’ve spent some time researching the error your getting.  It’s a very common error for Maps and AdMob.  But even for the posts including GPGS, the common response seems to be that the library isn’t being included.  I don’t see your build.settings in the previous posts.  Are you sure you don’t have an error in your build.settings that could be causing the plugin to not load?

Rob

Hi Rob,

Thank you so much for looking into this error. 

Below is my build.settings for Android build.  I appreciate you eyeballing it for me.

I plan on removing_ .permission.C2D_MESSAGE_ and com.google.android.c2dm.permission.RECEIVE permissions because, if I remember correctly, I added them for push notifications in 2 other games I released, but I don’t plan on adding it in my latest app.

And if you can easily tell what other permissions I can get rid of without looking up (I mean I respect your time and don’t expect you to look it up for me), please let me know.  All I need are permissions for in-app product, leaderboards, achievements and ads (Vungle and probably Chartboost.)

Thanks again.

Naomi

[lua]

– build.settings for Android

settings = {

    orientation = {

        default = “landscapeRight”,

        supported = 

        {

            “landscapeRight”, “landscapeLeft”, 

        },

    },

    android =

    {

        googlePlayGamesAppId = “xxxxxxxxxxxxxxx”, – Google Play Games App Id

    

        usesExpansionFile = true,

        permissions =

        {

            { name = “.permission.C2D_MESSAGE”, protectionLevel = “signature” },

        },

        

        usesPermissions =

        {

            “com.android.vending.BILLING”,

            “android.permission.GET_ACCOUNTS”,

            “android.permission.RECEIVE_BOOT_COMPLETED”,

            “com.google.android.c2dm.permission.RECEIVE”,

            “.permission.C2D_MESSAGE”,

            “android.permission.INTERNET”,

            “android.permission.ACCESS_WIFI_STATE”,

            “android.permission.ACCESS_NETWORK_STATE”,

            “com.android.vending.CHECK_LICENSE”, – need this for extension file

            “android.permission.WRITE_EXTERNAL_STORAGE”, – need this for Vungle ads & for extension file

         },

    },

    plugins =

    {

        – GOOGLE PLAY SERVICES (required for delivering ads)

        [“plugin.google.play.services”] = 

        {

            publisherId = “com.coronalabs”, supportedPlatforms = { android = true }, 

        },

        – GOOGLE PLAY GAME SERVICES

        [“CoronaProvider.gameNetwork.google”] = 

        { 

            publisherId = “com.coronalabs”, supportedPlatforms = { android = true }, 

        },

        – GOOGLE IAP V3 

        [“plugin.google.iap.v3”] = 

        { 

            publisherId = “com.coronalabs”, supportedPlatforms = { android = true }, 

        },

        – VUNGLE ADS FOR IOS AND GOOGLE

        [“CoronaProvider.ads.vungle”] = 

        { 

            publisherId = “com.vungle”, supportedPlatforms = { iphone = true, android = true }, 

        },      

        – CHARTBOOST ADS FOR IOS (GOOGLE version coming soon)

        [“plugin.chartboost”] = 

        { 

            publisherId = “com.gremlininteractive”, supportedPlatforms = { iphone = true }, 

        },

    },

}

[/lua]

EDIT:  I have license key in config.lua too that looks like this:

[lua]

application = 

    license = {

        googe = { key = “SuperDuperLoooooongTextString”,},

    },

}

[/lua]

-- I have license key in config.lua too application =&nbsp; &nbsp; &nbsp; &nbsp; license = { &nbsp; &nbsp; &nbsp; &nbsp; googe = { key = "SuperDuperLoooooongTextString",}, &nbsp; &nbsp; }, }

 

This should not be in build.settings.  It’s part of config.lua.   You also have google spelled wrong above.  Do you have it correct in your config.lua as well?