New gamenetwork API (gpgs) makes app crash

Apparently it is anything that uses:

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

I’m only using Applovin. I have incentivised video ads set up in my app and all of the other ad network options I’ve seen require this plugin too.

I was hoping to set up increment achievements for my app because once it’s published I won’t ever be able to change them.

So I have to decide whether to have increment achievements or incentivised video ads.

Are there any other options?

Thanks

Hey Rob,

The ID is correct and it matches the game’s ID on Google’s developer portal. I merely replaced the ID from the log before copying it to Corona forums so as to keep the ID secret.

Initially, I encountered an error that crashed the game when I tried to have my game automatically log in as the game started. Codewise, Init ran through, but then the log in process crashed the game. I did, however, have a manual log in button as well, which encountered no problems and I was able to view the game’s leaderboards (as was the intention).

Today, I tried setting a timer.perform with delay for the Init function, and it ran successfully a few times. Soon afterwards, it seized to work, and so did the previously operational manual log in button.

I have tried this out across several builds, on several devices, always keeping the version code the same. Whenever the game crashes, the error is always the same:

09-09 12:31:15.546 13566 22073 E ValidateServiceOp: Application ID (is the correct id but the last number is a ? symbol) must be a numeric value. Please verify that your manifest refers to the correct project ID.

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