gameNetwork.google issue

I keep on getting a fatal exception in my program when it tries to send a login request to the gameNetwork on my android build. Perhaps the plugin is not properly being included, has anyone else had this issue?

My code is pretty much the same as in the tutorial introducing GPGS.

The log shows “The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.” after it tries to do the login request in gpgsInitCallback below.

My build.settings:

settings = { orientation = { default = "landscapeRight", supported = { {"landscapeRight"} -- portrait landscapeRight } }, android = { googlePlayGameAppId="myappid", usesPermissions = { "com.android.vending.BILLING", "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", }, }, plugins = { --key is the name passed to the Lua "require()" ["CoronaProvider.gameNetwork.google"] = { --required! publisherId = "com.coronalabs", }, }, }

my main.lua:

local gameNetwork= require "gameNetwork" local device = require("device") local gcCallBack local onSystemEvent local loadLocalPlayerCallback local gameNetworkLoginCallback local gpgsInitCallback local licensingListener -- hide status bar display.setStatusBar( display.HiddenStatusBar ) local g\_loggedIntoGC=false local g\_loggedIntoGPGS=false local licensing local playerName -- google game services functions function loadLocalPlayerCallback (event) playerName=event.data.alias g\_loggedIntoGPGS=true --saveSettings() -- save player data locally end function gameNetworkLoginCallback(event) gameNetwork.request( "loadLocalPlayer", { listener=loadLocalPlayerCallback } ) return true end function gpgsInitCallback( event ) gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) end -- game network setup local function gameNetworkSetup() if (device.isApple) then gameNetwork.init( "gamecenter", gcCallBack ) else gameNetwork.init( "google", gpgsInitCallback ) end end function onSystemEvent(event) if (event.type=="applicationStart") then gameNetworkSetup() -- set up game network return true end end Runtime:addEventListener("system",onSystemEvent)

Hi @zrm310,

I know this is an obvious question, but are you putting in your actual Google Play app ID in the build settings? Your code shows that you haven’t, but maybe that’s just a cut-and-paste (or you replaced it to not show publicly what that ID is).

Best regards,

Brent

Hi Brent, Thanks for the reply. Yep I have my actual app id in my build settings. I just removed it for the post. I just updated to the latest daily build and still have the problem. Is it supposed to be downloading and saving the plugin somewhere when I build that I can see check and see if its there? And if so, is there a local build error log or something I can check for clues why it’s not downloading or incorporating it into the apk? Thanks, Rohan

I tried other plugins just now, for eg the zip plugin and sample code, and it is working properly. For some reason its just the gameNetwork.google plugin which is seemingly not being built into the apk.

Hi @zrm310,

I think the correct term in the build.settings is:

googlePlayGamesAppId

(instead of)

googlePlayGameAppId

Notice the “s” in there. Please try this and let me know if it works.

Thanks,

Brent

Wow, Brent you’re a lifesafer! It all works now!

I usually copy 'n paste all the tutorial code as a starting point so I can’t believe I introduced an error like that. And the fatal exception mentioning the google play resources were not found sent me in the wrong direction when I tried to figure this out. Thanks again!

Great, have fun with it! :slight_smile:

Hi @zrm310,

I know this is an obvious question, but are you putting in your actual Google Play app ID in the build settings? Your code shows that you haven’t, but maybe that’s just a cut-and-paste (or you replaced it to not show publicly what that ID is).

Best regards,

Brent

Hi Brent, Thanks for the reply. Yep I have my actual app id in my build settings. I just removed it for the post. I just updated to the latest daily build and still have the problem. Is it supposed to be downloading and saving the plugin somewhere when I build that I can see check and see if its there? And if so, is there a local build error log or something I can check for clues why it’s not downloading or incorporating it into the apk? Thanks, Rohan

I tried other plugins just now, for eg the zip plugin and sample code, and it is working properly. For some reason its just the gameNetwork.google plugin which is seemingly not being built into the apk.

Hi @zrm310,

I think the correct term in the build.settings is:

googlePlayGamesAppId

(instead of)

googlePlayGameAppId

Notice the “s” in there. Please try this and let me know if it works.

Thanks,

Brent

Wow, Brent you’re a lifesafer! It all works now!

I usually copy 'n paste all the tutorial code as a starting point so I can’t believe I introduced an error like that. And the fatal exception mentioning the google play resources were not found sent me in the wrong direction when I tried to figure this out. Thanks again!

Great, have fun with it! :slight_smile: