New gamenetwork API (gpgs) makes app crash

When you copy and paste numbers from websites, it sometimes picks up hidden characters or extra spaces that can be hard to see. Can you erase everything in the Application Id field including the quotes and hand type them in?

Rob

Hi Rob,

I have now hand typed the id and made sure that it is correct. The error still occures sometimes. I have found out that if I just keep building the app multiple times without making any changes to the code the log in works on some builds without crashing the app. I also made sure it is not time releated. So it seems that the issue is the plugin or with corona. Please let me know if need more logs or info on my behalf.

Simulator version 2016.2906
 

Do you have licensing information in your config.lua?

Rob

Yes I have:

config.lua

[lua]

license =

{

     google =

     {

          key = “OUR KEY”,

     },

},

[/lua]

and in main.lua

[lua]
local licensing = require( “licensing” )

licensing.init( “google” )

[/lua]

I have tried several times to build with or without those main.lua lines and it seems to have no impact on the crashing.

i’ve exactly same problem, game is crashing upon start when using plugin.gpgs. i’ve licence info and googlePlayGamesAppId included, google leaderboards setup etc…

i found out, when i disable plugin.googleAnalytics it’s not crashing

plugin.googleAnalytics has never been enabled in our project.

@quuood, what plugins do you have enabled? Posting your build.settings would be great!

Thanks

Rob

Sure!

Here is our build settings:

[lua]

settings =

{

  orientation =

  {

     default = “portrait”,

     supported = { “portrait”, }

  },

  excludeFiles =

  {

     iphone = { “Icon-*dpi.png”, },

     android = { “Icon.png”, “Icon-Small-*.png”, “Icon*@2x.png”, },

  },

– iOS Section

  iphone =

  {

     plist =

    {

       UIStatusBarHidden = false,

       UIPrerenderedIcon = true,

       CFBundleIconFiles =

          {

             “Icon.png”,

             “Icon@2x.png”,

             “Icon-167.png”,

             “Icon-60.png”,

             “Icon-60@2x.png”,

             “Icon-60@3x.png”,

             “Icon-72.png”,

             “Icon-72@2x.png”,

             “Icon-76.png”,

             “Icon-76@2x.png”,

             “Icon-Small.png”,

             “Icon-Small@2x.png”,

             “Icon-Small@3x.png”,

             “Icon-Small-40.png”,

             “Icon-Small-40@2x.png”,

             “Icon-Small-50.png”,

             “Icon-Small-50@2x.png”,

          },

      }

  },

  android =

    {

       googlePlayGamesAppId ="**********133",

    },

  plugins =

  {

      [“plugin.gpgs”] =

      {

         publisherId = “com.coronalabs”,

         supportedPlatforms = { android=true }

       },

      [“CoronaProvider.gameNetwork.apple”] =

      {

          publisherId = “com.coronalabs”,

          supportedPlatforms = { iphone=true, [“iphone-sim”]=true },

      },

      [“plugin.adbuddiz”] =

      {

          publisherId = “com.adbuddiz”

       },

       [“CoronaProvider.ads.vungle”] =

       {

          publisherId = “com.vungle”

       },

       [“plugin.google.iap.v3”] =

      {

        publisherId = “com.coronalabs”,

        supportedPlatforms = { android=true }

      },

},

– Android permissions

androidPermissions = {

    “android.permission.READ_PHONE_STATE”,

    “android.permission.INTERNET”,

    “android.permission.WRITE_EXTERNAL_STORAGE”,

    “android.permission.ACCESS_WIFI_STATE”,

    “android.permission.ACCESS_NETWORK_STATE”,

    “com.android.vending.BILLING”,

    “com.android.vending.CHECK_LICENSE”,

  },

}

[/lua]

quuood, I couldn’t figure out yet why it’s crashing for you. Have you tried removing all plugins from build.settings except gpgs?
Also can you please send me a crashing APK for investigation?

I seem to have found the cause of the crash.

The random crashes were fixed when I moved the androidPermissions table inside the android table in the build.settings file. This had not been a cause for errors (or crashes) in any previous projects I had worked on.

Now that the androidPermissions table is relocated, I have been able to build and run the app successfully multiple times without any errors. Nevertheless, thank you for your support!

Where in the documentation has it been stated that “androidPermissions” moved outside of the android table?

https://docs.coronalabs.com/daily/guide/distribution/buildSettings/index.html#permissions

I’m having issues too… latest build 2954.

build.settings has everything disabled other than gpgs plugin…

using a device with Android 5.1…

gpgs.init() returns this event:

{type="init",isError=false,name="init"}

gpgs.login() using userInitiated=true (or false) returns this event:

{isError=true,phase="logged in",errorMessage="internal error",name="login",errorCode=8}

@borderleap, the way I read @quuood’s message is his permissions were outside the android table and he moved them inside the table which fixed the problem. They have to be in the android sub-table.

I did a quick search on the error.  Here is what Google has to say:

public static final int INTERNAL_ERROR

An internal error occurred. Retrying should resolve the problem.

Constant Value: 8

There wasn’t much else discussing fixes for it.

This error is coming from Google. I would verify that everything is setup correctly in the developer portal. Make sure you’re using a release keystore and not the debug one. Make sure you’re testing with a non-developer account. That’s an In-App Purchase rule but who knows if Google extended it to GPGS.

Rob

Thanks Rob.  I made sure my usesPermissions table is nested inside the android table…  Then, I switched back to the legacy gameNetwork plugin, and all works fine.  When I make the switch to the new GPGS plugin, then I get the errors above and login never happens.

For now, unfortunately I’m going to have to stick with the legacy plugin…

@borderleap,

quuood and I’ve experienced the same issue. If I remember correctly, your issue might originate from a few things:

  • some of Google’s services require you to publish the game to (closed or open) alpha or beta in order for you to actually test them. You also need to make sure that your gmail account is listed as a tester account in the developer console. 
  • you may also need to enable certain APIs from Google’s developer console for gpgs to work. If this is the case, you usually find an error message in the console that prompts you which APIs you need to enable (and how). 

I experienced the exact same thing and just stuck to the legacy plugin. Everything is working great. It’s too bad the new plugin didn’t work.

Most of you are reporting different issues. Not all GPGS errors are related. This internal error 8 is being sent from Google’s servers. It’s likely a configuration problem or an account problem since the only response is “Try again”.

If you’re having other errors let’s get them fixed so we can get you on the newer GPGS.

Rob

Hi

I need leaderboard and admob ads in my application

in my build.setting file

[“plugin.google.play.services”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { iphone=true, android=true }
},

[“plugin.gpgs”] =
{
publisherId = “com.coronalabs”,
supportedPlatforms = { android=true }
}

these two plugins I have added

when I do this at the corona server side there is something problem with google play service and it gives me below error

ava.lang.IllegalStateException: The meta-data tag in your app’s AndroidManifest.xml does not have the right value.  Expected 9452000 but found 4242000.  You must have the following declaration within the <application> element:     <meta-data android:name=“com.google.android.gms.version” android:value="@integer/google_play_services_version" />

If I removed “plugin.google.play.services” plugin from build.setting and removed admob code  then its working fine.

but I need both plugins at a time so please fix it asap.

for admob I refer https://docs.coronalabs.com/plugin/ads-admob-v2/index.html

for gpgs https://docs.coronalabs.com/plugin/gpgs/index.html

Thanks.

Really no one reads my post yet ?

I guess it happens when you use both admob and new gpgs plugin. I too had that problem but when I remove the admob plugin it works fine. I think it giving an error about play services version because we import admob plugin in a weird way like this.  

["plugin.google.play.services"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, android=true } },&nbsp;

and the gpgs plugin like this.

["plugin.gpgs"] = { publisherId = "com.coronalabs", supportedPlatforms = { android=true } }&nbsp;

But the old gameNetwork plugin works fine with admob. 

plugin like this.