Unable to get gameNetwork to work with Android Device

Hey there,

I have integrated the gameNetwork in my game, followed all steps and added all required params in build.settings and everything seems in place (+ added leaderboard, linked app, etc)

But when I post a highScore or try to display the leaderboard, nothing happens.

Checked the device logs and this is what I see:

W/System.err﹕ java.lang.ClassNotFoundException: CoronaProvider.gameNetwork.gamecenter.LuaLoader

I have also tried to re-install CoronaSDK from scratch but it didn’t help.

Am I missing anything that’s NOT mentioned here?

http://coronalabs.com/blog/2013/06/25/tutorial-introducing-google-play-game-services/

Thanks!

What version of Corona SDK are you running?

Are you on a Mac or PC

What device are you testing on?

Can you post your build.settings file?

Can you post your config.lua file?

Can you post your code where you are setting up gameNetwork and initializing it?

Can you post more of the console log (some lines before and after please).

Thanks

Rob

o

Hey Rob,
 
I’m on Mac, Corona v. 2014.2210 (2014.3.21)
Testing on a Samsung Galaxy S3 Mini (android 4.1.2)
 
 
build.settings
 
[lua]
settings = {

orientation =
{
default = “portrait”,
supported = { “portrait” }
},

android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.READ_PHONE_STATE”
},
googlePlayGamesAppId = “0000000000000000” – I’m using my long numeric ID from the game center here
},

plugins =
{
[“CoronaProvider.ads.admob”] =
{
– required
publisherId = “com.coronalabs”
},
[“CoronaProvider.gameNetwork.google”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android = true }
}
}

}

[/lua]
 
config.lua
 
[lua]
application = {
    content = {
    width = 320,
    height = 568, 
    scale = “zoomEven”,
        xAlign = “center”,
        yAlign = “center”,        
    fps = 60
    }
}
 
[/lua]
 
I have previously tried with what the tutorial says but right now I am using this:
https://github.com/GlitchGames/GGGameCentre
 
and calling:
[lua]
 
local gameCentre = GGGameCentre:new()
 
gameCentre:showLeaderboards(“leader-board-id-from-google-play”)
 
[/lua]
 
I have also looked into the CGGameCentre plugin and the method “showLeaderboards” is actually doing the right thing.

It also requires the “gameNetwork” correctly.
 
Note: it works perfectly fine in iOS - the issue is *ONLY* with Android.
 
Here are the logs form the device:

03-24 22:35:00.270  22989-30479/? W/System.err﹕ java.lang.ClassNotFoundException: CoronaProvider.gameNetwork.gamecenter.LuaLoader

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at java.lang.Class.classForName(Native Method)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at java.lang.Class.forName(Class.java:217)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at java.lang.Class.forName(Class.java:172)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.NativeToJavaBridge.callLoadClass(NativeToJavaBridge.java:337)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:316)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:357)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ Caused by: java.lang.NoClassDefFoundError: CoronaProvider/gameNetwork/gamecenter/LuaLoader

Any help would be appreciated.

Thanks

I don’t know much about Graham’s module.  Does it support Android?

Could you have an error in your build.settings preventing the plugin from loading?

Rob

Hi Rob,

The module supports Android and from the device logs, it’s clearly something at a lower level, the gameNetwork lib doesn’t seem to be getting included at all in the build.

As mentioned, even when NOT using the plugin but following the blog and documentation, it still doesn’t work for a basic leaderboard display call.

If it’s an error in my build.settings, that’s what I am after by posting here :slight_smile:

Cheers,

Leandro

Your build.settings look good.  Let me check with the team and see if they recognize anything.

Actually they are going to want to see some code and we can’t support 3rd party libraries.  So what I need you to do is to try this without the Glitch Games library, at least take the tutorial and run it through the system.  When you have an example that doesn’t use GG code, I can as engineering.

Rob

Thanks Rob.

Just wondering if you have any updates on this?

Cheers

I guess you didn’t see the note I added about needing to see some source and it having to be without the GG library that I added above.

Rob

Here’s how I do it:

[lua]

local gameNetwork = require(“gameNetwork”)

local function initCallback( event )

    – init callback

end

local function gpgsInitCallback( event )

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

end

gameNetwork.init( “google”, gpgsInitCallback)

– to show leaderboards I call

gameNetwork.show(“leaderboards”)

[/lua]

thanks!

Any updates here?

What version of Corona SDK are you running?

Are you on a Mac or PC

What device are you testing on?

Can you post your build.settings file?

Can you post your config.lua file?

Can you post your code where you are setting up gameNetwork and initializing it?

Can you post more of the console log (some lines before and after please).

Thanks

Rob

o

Hey Rob,
 
I’m on Mac, Corona v. 2014.2210 (2014.3.21)
Testing on a Samsung Galaxy S3 Mini (android 4.1.2)
 
 
build.settings
 
[lua]
settings = {

orientation =
{
default = “portrait”,
supported = { “portrait” }
},

android =
{
usesPermissions =
{
“android.permission.INTERNET”,
“android.permission.ACCESS_NETWORK_STATE”,
“android.permission.READ_PHONE_STATE”
},
googlePlayGamesAppId = “0000000000000000” – I’m using my long numeric ID from the game center here
},

plugins =
{
[“CoronaProvider.ads.admob”] =
{
– required
publisherId = “com.coronalabs”
},
[“CoronaProvider.gameNetwork.google”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android = true }
}
}

}

[/lua]
 
config.lua
 
[lua]
application = {
    content = {
    width = 320,
    height = 568, 
    scale = “zoomEven”,
        xAlign = “center”,
        yAlign = “center”,        
    fps = 60
    }
}
 
[/lua]
 
I have previously tried with what the tutorial says but right now I am using this:
https://github.com/GlitchGames/GGGameCentre
 
and calling:
[lua]
 
local gameCentre = GGGameCentre:new()
 
gameCentre:showLeaderboards(“leader-board-id-from-google-play”)
 
[/lua]
 
I have also looked into the CGGameCentre plugin and the method “showLeaderboards” is actually doing the right thing.

It also requires the “gameNetwork” correctly.
 
Note: it works perfectly fine in iOS - the issue is *ONLY* with Android.
 
Here are the logs form the device:

03-24 22:35:00.270  22989-30479/? W/System.err﹕ java.lang.ClassNotFoundException: CoronaProvider.gameNetwork.gamecenter.LuaLoader

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at java.lang.Class.classForName(Native Method)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at java.lang.Class.forName(Class.java:217)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at java.lang.Class.forName(Class.java:172)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.NativeToJavaBridge.callLoadClass(NativeToJavaBridge.java:337)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.JavaToNativeShim.nativeResize(Native Method)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.JavaToNativeShim.resize(JavaToNativeShim.java:316)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onSurfaceChanged(CoronaGLSurfaceView.java:357)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1611)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)

03-24 22:35:00.270  22989-30479/? W/System.err﹕ Caused by: java.lang.NoClassDefFoundError: CoronaProvider/gameNetwork/gamecenter/LuaLoader

Any help would be appreciated.

Thanks

I don’t know much about Graham’s module.  Does it support Android?

Could you have an error in your build.settings preventing the plugin from loading?

Rob

Hi Rob,

The module supports Android and from the device logs, it’s clearly something at a lower level, the gameNetwork lib doesn’t seem to be getting included at all in the build.

As mentioned, even when NOT using the plugin but following the blog and documentation, it still doesn’t work for a basic leaderboard display call.

If it’s an error in my build.settings, that’s what I am after by posting here :slight_smile:

Cheers,

Leandro

Your build.settings look good.  Let me check with the team and see if they recognize anything.

Actually they are going to want to see some code and we can’t support 3rd party libraries.  So what I need you to do is to try this without the Glitch Games library, at least take the tutorial and run it through the system.  When you have an example that doesn’t use GG code, I can as engineering.

Rob

Thanks Rob.

Just wondering if you have any updates on this?

Cheers

I guess you didn’t see the note I added about needing to see some source and it having to be without the GG library that I added above.

Rob

Here’s how I do it:

[lua]

local gameNetwork = require(“gameNetwork”)

local function initCallback( event )

    – init callback

end

local function gpgsInitCallback( event )

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

end

gameNetwork.init( “google”, gpgsInitCallback)

– to show leaderboards I call

gameNetwork.show(“leaderboards”)

[/lua]

thanks!

Any updates here?