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)