Hi,
I just read some tutorials here about Google Game Play Services and I have a Developer account.
main.lua doesn’t seem to go further then to this line:
gameNetwork.init( “google”, gpgsInitCallback )
I checked the log (through adb) and here is some error output:
V/Corona (22461): \> Class.forName: CoronaProvider.gameNetwork.google.LuaLoader V/Corona (22461): Loading plugins: CoronaProvider.gameNetwork.google.LuaLoader D/dalvikvm(22481): GC\_CONCURRENT freed 145K, 12% free 18095K/20544K, paused 3ms+1ms, total 19ms V/Corona (22461): Failed to write file: /data/data/chinese.jefecitostudios.com/cache/.system/resources/plugins.dex for library CoronaProvider.gameNetwork.google. I/Corona (22461): Runtime error I/Corona (22461): ERROR: Could not load provider (google) due to the following reason: module 'CoronaProvider.gameNetwork.google' not found:resource (CoronaProvider.gameNetwork.google.lu) does not exist in archive I/Corona (22461): no field package.preload['CoronaProvider.gameNetwork.google'] I/Corona (22461): no file '(null)/CoronaProvider.gameNetwork.google.lua' I/Corona (22461): no file '(null)/CoronaProvider.gameNetwork.google.lua' I/Corona (22461): no file '/data/data/chinese.jefecitostudios.com/lib/libCoronaProvider.gameNetwork.google.so' I/Corona (22461): no file './CoronaProvider.gameNetwork.google.so' I/Corona (22461): no file '(null)/CoronaProvider.gameNetwork.google.so' I/Corona (22461): no file '/data/data/chinese.jefecitostudios.com/lib/libCoronaProvider.so' I/Corona (22461): no file './CoronaProvider.so' I/Corona (22461): no file '(null)/CoronaProvider.so'. I/Corona (22461): stack traceback: I/Corona (22461): [C]: ? I/Corona (22461): [C]: in function 'assert' I/Corona (22461): ?: in function 'requireProvider' I/Corona (22461): ?: in function 'setCurrentProvider' I/Corona (22461): ?: in function 'init' I/Corona (22461): ...\Jefecito\Documents\Corona Projects\Chinese\main.lua:28: in function 'gameNetworkSetup' I/Corona (22461): ...\Jefecito\Documents\Corona Projects\Chinese\main.lua:4
This is my build.settings:
-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", } }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend --[[-- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXXXXXXX", -- example scheme for facebook "coronasdkapp", -- example second scheme } } } --]] } }, android = { googlePlayGamesAppId = "945719169679" --long App ID number (use yours!) }, plugins = { --key is the name passed to the Lua "require()" ["CoronaProvider.gameNetwork.google"] = { --required! publisherId = "com.coronalabs", }, }, --[[-- Android permissions androidPermissions = { "android.permission.INTERNET", },]]-- }
Right now main.lua doesn’t try to do anything else then to connect to GGPS:
local normalchinese = require 'normalchinese' local gameNetwork = require( "gameNetwork" ) local widget = require( "widget" ) local function loadLocalPlayerCallback( event ) display.newText("loadLocalPlayerCallback", 0, 100, native.systemFont, 16) playerName = event.data.alias display.newText(playerName, 0, 120, native.systemFont, 16) --saveSettings() --save player data locally using your own "saveSettings()" function end local function gameNetworkLoginCallback( event ) display.newText("gameNetworkLoginCallback", 0, 80, native.systemFont, 16) gameNetwork.request( "loadLocalPlayer", { listener=loadLocalPlayerCallback } ) return true end local function gpgsInitCallback( event ) display.newText("gpgsInitCallback", 0, 60, native.systemFont, 16) gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) end local function gameNetworkSetup() display.newText("gameNetworkSetup", 0, 40, native.systemFont, 16) if ( system.getInfo("platformName") == "Android" ) then display.newText("google", 150, 40, native.systemFont, 16) gameNetwork.init( "google", gpgsInitCallback ) else display.newText("gamecenter", 150, 40, native.systemFont, 16) gameNetwork.init( "gamecenter", gameNetworkLoginCallback ) end end ------HANDLE SYSTEM EVENTS------ local function systemEvents( event ) display.newText("systemEvents", 0, 20, native.systemFont, 16) print("systemEvent " .. event.type) if ( event.type == "applicationSuspend" ) then print( "suspending..........................." ) elseif ( event.type == "applicationResume" ) then print( "resuming............................." ) elseif ( event.type == "applicationExit" ) then print( "exiting.............................." ) elseif ( event.type == "applicationStart" ) then gameNetworkSetup() --login to the network here end return true end Runtime:addEventListener( "system", systemEvents ) local function showLeaderboards( event ) display.newText(system.getInfo("platformName"), 0, 0, native.systemFont, 16) if ( system.getInfo("platformName") == "Android" ) then gameNetwork.show( "leaderboards" ) else gameNetwork.show( "leaderboards", { leaderboard = {timeScope="AllTime"} } ) end return true end function onButtonEvent() showLeaderboards() end local myButton = widget.newButton { left = 200, top = 80, label = "Show Leaderboard", labelAlign = "center", font = "Arial", fontSize = 18, labelColor = { default = {0,0,0}, over = {255,255,255} }, onEvent = onButtonEvent } myButton.baseLabel = "Default" function main() -- showLeaderboards() --mainNormalChinese() end main()
Under my Google Developer account I can see under “Linked Apps” that the package name is the same as under Corona:
chinese.jefecitostudios.com
I have verified the AppID aswell.
What can be wrong with this?
I feel there might be something with the setup of my app under Google as the code is more or less copy-and-paste from the tutorial (http://www.coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/)
Thanks in advanced for your help!
Best regards,
Tomas