Android Game Services always crashes on Nexus 7

Where do I enter the SHA1 key into Corona?

Here’s my Config:
[lua]

application = {
content = {
width = 640,
height = 960, --1136
scale = “zoomstretch”,
fps = 60,
launchpad = false,
},
}
[/lua]

Here’s my Build.settings, sorry about how messy it is:

[lua]

– Supported values for orientation:
– portrait, portraitUpsideDown, landscapeLeft, landscapeRight

settings = {

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

iphone = {
plist = {
UIStatusBarHidden = true,
UIPrerenderedIcon = true, – set to false for “shine” overlay
–UIApplicationExitsOnSuspend = true, – uncomment to quit app on suspend
UIAppFonts =
{
“Hiruko.otf”
}

–[[
– iOS app URL schemes:
CFBundleURLTypes =
{
{
CFBundleURLSchemes =
{
“fbXXXXXXXXXXXXXX”, – example scheme for facebook
“coronasdkapp”, – example second scheme
}
}
}
–]]
},
components = {

}
},

android =
{
usesPermissions =
{
“android.permission.INTERNET”,
googlePlayGamesAppId = “182739516720”
}

},

plugins =
{
–key is the name passed to the Lua “require()”
[“CoronaProvider.gameNetwork.google”] =
{
–required!
publisherId = “com.coronalabs”,
},
},
}
[/lua]

I think I might have the wrong App ID because I did have some trouble finding it, I might have the wrong number. How do I find it in the google play dev console?

Hi AppdojoStudios

Please read the documentation there are some additional information’s about the Google Play Game Service and the error
handling. I had with the first release also some problems but after Integration of the error handling in my code it works fine. Important the user must have his google+ account extend with the GPGS, I ask the users always on the first
lunch of the app if he like to use the GPGS and if they have a goole+ account which can be used for the service.

 

http://docs.coronalabs.com/plugin/gameNetwork-google/init.html

BR

Michael

 

Thanks for showing me the error handling! I implemented that and simplified my code and this is what it is now:

[lua]

    local function gameNetworkLoginCallback( event )

        --nothing here just for testing

    end

    local function gpgsInitCallback( event )

        print(event.isError, “#######EVENTERROR######”)

        if event.isError == nil then

            print(“Initialize GPGS”)

            loggedIntoGC = true

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

        elseif event.isError == true then

            print(event.errorMessage, “############ERROR###########”)

        end

    end

    gameNetwork.init( “google”, gpgsInitCallback )

[/lua]

So in the console (on device) it prints event.isError as “nil” so it seems like thats working and then it crashes on the login. 

go to the android Settings Screen, Application, select your application, stop the application and clean Cache and app data. check if there other apps running they like to use the same function.

Michael

did you Register the user for testing in the Google Play Service for your app?

There are no other apps running, I cleared the app cache and data, and yes my google account is setup with google+ and is setup as a developer for the app.

Could it possible be that I got the wrong number for the App ID? Or would that just show an error later on?

The id is displayed on the right site in the google play service site. At the position 5 (test) clear your account name, save the settings and enter the e mail again.

I’m pretty sure I have the right ID now and I cleared the emails but it still crashes :frowning:

YEEESS!!! I finally figured it out!! I stupidly added the googlePlayGamesAppId (build.settings) into the usesPermissions table instead of just the android table. Here is my new android table in my build.settings:

[lua]

    android = 

    {

        googlePlayGamesAppId = “182739516720”,

        usesPermissions =

        {

            “android.permission.INTERNET”, 

        }

    },

[/lua]

Thank you everyone for your help!

Muhuhahhaa!!! Thank you soooo muchh!! I had a similar problem! I followed the tutorial and finally found my error:

WRONG WAY -->

android = { usesPermissions = { "android.permission.INTERNET", -- Required for Inneractive "android.permission.ACCESS\_NETWORK\_STATE", -- Required for Inneractive "android.permission.READ\_PHONE\_STATE", -- Required for Inneractive "com.android.vending.BILLING", -- Required for In App Purchases }, { googlePlayGamesAppId = "123456789" -- Required for GPGS, Google Play Games App Id }, },

CORRECT WAY -->
 

android = { usesPermissions = { "android.permission.INTERNET", -- Required for Inneractive "android.permission.ACCESS\_NETWORK\_STATE", -- Required for Inneractive "android.permission.READ\_PHONE\_STATE", -- Required for Inneractive "com.android.vending.BILLING", -- Required for In App Purchases }, googlePlayGamesAppId = "123456789" -- Required for GPGS, Google Play Games App Id },

Muhuhahhaa!!! Thank you soooo muchh!! I had a similar problem! I followed the tutorial and finally found my error:

WRONG WAY -->

android = { usesPermissions = { "android.permission.INTERNET", -- Required for Inneractive "android.permission.ACCESS\_NETWORK\_STATE", -- Required for Inneractive "android.permission.READ\_PHONE\_STATE", -- Required for Inneractive "com.android.vending.BILLING", -- Required for In App Purchases }, { googlePlayGamesAppId = "123456789" -- Required for GPGS, Google Play Games App Id }, },

CORRECT WAY -->
 

android = { usesPermissions = { "android.permission.INTERNET", -- Required for Inneractive "android.permission.ACCESS\_NETWORK\_STATE", -- Required for Inneractive "android.permission.READ\_PHONE\_STATE", -- Required for Inneractive "com.android.vending.BILLING", -- Required for In App Purchases }, googlePlayGamesAppId = "123456789" -- Required for GPGS, Google Play Games App Id },