Package names and Google Play Game Services issues

Hi all,

I’m having issues trying to get my game logging into Google Play.  I have followed the great tutorials by Rob Miracle and read a number of posts related to issues with connecting / logging into GPGS from an Android device.

I’ve made sure I’m using the correct SHA1 code.  I’ve made sure I’m using a release keystore in the .apk file.  I’ve uploaded the .apk file as an Alpha build and I have specified myself as a tester.  All the steps in the Dev Console have a green tick.  I have installed adb and looked at the output.  Nothing really stands out other than the line:

W/ActivityManager( 812) destPackageName = null

My simple GPGS code is as follows:

local function loadLocalPlayerCallback( event )    print('\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 3. in loadLocalPlayerCallback')    loggedIntoGC = true end

local function gameNetworkLoginCallback( event )    print('\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 2. in gameNetworkLoginCallback')    gameNetwork.request( "loadLocalPlayer", { listener=loadLocalPlayerCallback } )    return true end

local function gpgsInitCallback( event )    print('\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1. in gpgsInitCallback')    gameNetwork.request( "login", { userInitiated=true, listener=gameNetworkLoginCallback } ) end

gameNetwork.init( "google", gpgsInitCallback )

What is printed out from the above in the adb console is:

\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 1. in gpgsInitCallback \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* 2. in gameNetworkLoginCallback

The 3rd print statement (in the loadLocalPlayerCallback function) is never printed meaning the callback isn’t being fired.

I’ve tried everything and the only thing that springs to mind now is that my package names are different.

In the GP Dev Console -> Game Services -> Linked apps, the package name is:

com.XXXX.YYYY

In the ‘Build for Android’ dialog in Corona, the package name is:

com.gmail.AAAA.BBBB.CC_DDDD

So I tried changing the package name in the Corona build dialog to com.XXXX.YYYY  (the same as the one in the Linked apps field) and uploaded the .apk file.

After uploading completed, the developer console showed an error saying that my .apk file needed to have the package com.gmail.AAAA.BBBB.CC_DDDD.

How do I successfully upload a .apk with the same package names?  How is the Corona package name generated? I’ve spend 4 days trying to get GPGS working and I’d love some other ideas / help.

So any help would be so very appreciative.

Thanks!

Can you post your build.settings file?

Also a screen shot of your build screen just before you click the build button would be helpful. 

In general, what ever you create for the package name in Google Play is what you have to use when you build the app. 

Rob

Hi Rob,

Here is the Build for Android dialog:

BuildForAndroidDialog.png

Within the google play developer console, the package is:  com.enormaceapps.goballistic

So I tried changing the package name from  com.gmail.rozental.norman.Go_Ballistic to  com.enormaceapps.goballistic in the Build for Android Dialog (so it’s the same as in Google Play) and the following error is shown after uploading the .apk file:

apkError.png

It’s almost as if the .apk file contains the package name:  com.gmail.rozental.norman.Go_Ballistic.

And here is the build.settings contents as requested:

settings =  { orientation = { default = "portrait", supported = { "portrait" } }, iphone = { plist = {             CFBundleShortVersionString = "1.0.1", UIStatusBarHidden = true, UIPrerenderedIcon = true, -- set to false for "shine" overlay, UIAppFonts =             {                 "i\_fink\_u\_freeky.ttf"             }, CFBundleIconFile = "Icon.png", CFBundleIconFiles = {                 "Icon.png",                  "Icon@2x.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-40@3x.png",                 "Icon-Small-50.png",                  "Icon-Small-50@2x.png", },             UILaunchImages = {                 {  -- iPhone 4 Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  -- iPhone 5 Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 568}"                 },                 {  -- iPad Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-Portrait",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{768, 1024}"                 },                 {  -- iPhone 6 Portrait                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-667h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{375, 667}"                 },                 {  -- iPhone 6 Plus Portrait                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-736h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{414, 736}"                 }              }, }, },     android =     {         versionCode = 8,         googlePlayGamesAppId = "20154420814",         usesPermissions =         {             "com.android.vending.BILLING",         },     }, plugins =     {         -- key is the name passed to Lua's 'require()'         ["CoronaProvider.ads.iads"] =         {             -- required             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true }         },         ["CoronaProvider.gameNetwork.apple"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true, ["iphone-sim"]=true },         },         ["CoronaProvider.native.popup.social"] =         {             --required             publisherId = "com.coronalabs",         },         --key is the name passed to the Lua "require()"        ["CoronaProvider.gameNetwork.google"] =        {           --required!           publisherId = "com.coronalabs",           supportedPlatforms = { android=true },        },        ["plugin.google.iap.v3"] =        {           publisherId = "com.coronalabs",           supportedPlatforms = { android=true }        },        ["plugin.google.play.services"] =        {           publisherId = "com.coronalabs",           supportedPlatforms = { android=true }        },     } }

You can make a call to system.getInfo( “androidAppPackageName” ) to retrieve the package name used in your Android app and display/print it for verification purposes.

https://docs.coronalabs.com/daily/api/library/system/getInfo.html

Hey Tom,

Thanks for the tip.  I tested the above call and I can see that the change is reflected to whatever I type in the package text field of the build console.

I installed the .apk file onto my device (not via Google Play) using the package name com.enormacegames.goballistic (which is the same as google play) and Game Services works like a charm :slight_smile:

So that is great.

However the issue is that if I upload this same .apk file into Google Play it still expects the package name to be:

com.gmail.rozental.norman.Go_Ballistic

(See screenshot above for the error).  How would Google Play know of this package name?  It must be referenced in the .apk package perhaps?

I even used the aapt tool to find out the package name and the package name is correct.  The .apk file contains the package name com.enormacegames.goballistic as expected.

All the URLs in Google Play have the package name ‘com.gmail.rozental…’ so it looks like this was created from the original .apk file I uploaded a couple of weeks ago.

As a test I created a new application and uploaded the .apk (with the package name com.enormacegames.goballistic) and it worked.

Sigh…

So I might have to add / upload all the content again using the new application… :frowning:

When you created the app on Google Play you told it what name you were going to use.  That’s the name you have to use when you submit to Google.  Did you submit it once with one package name and then decide to change the name?

Rob

Hi Rob,

I’ve always had the same package name but only needed to change it because the package name text field in the Google Play -> Game Services -> Linked Apps is: com.enormacegames.goballistic

I’m assuming I added that myself when I first created the Game Services.  And this can’t be changed.  It’s read only.

The issue appears to be the URL for the game in Google Play contains the other package name (com.gmail.rozental.norman.Go_Ballistic) that must have been generated when I first uploaded my .apk file.

And that is why I get the error when uploading a .apk file with the package name com.enormacegames.goballistic

Please note: com.gmail.rozental.norman.Go_Ballistic was auto generated by Corona and I should have changed it accordingly.

They have to match, so creating a new Google Play app using the same package name that you used for GPGS is required.

Rob

Yep, in the process of doing that.  Thanks again Rob and Tom.

Can you post your build.settings file?

Also a screen shot of your build screen just before you click the build button would be helpful. 

In general, what ever you create for the package name in Google Play is what you have to use when you build the app. 

Rob

Hi Rob,

Here is the Build for Android dialog:

BuildForAndroidDialog.png

Within the google play developer console, the package is:  com.enormaceapps.goballistic

So I tried changing the package name from  com.gmail.rozental.norman.Go_Ballistic to  com.enormaceapps.goballistic in the Build for Android Dialog (so it’s the same as in Google Play) and the following error is shown after uploading the .apk file:

apkError.png

It’s almost as if the .apk file contains the package name:  com.gmail.rozental.norman.Go_Ballistic.

And here is the build.settings contents as requested:

settings =  { orientation = { default = "portrait", supported = { "portrait" } }, iphone = { plist = {             CFBundleShortVersionString = "1.0.1", UIStatusBarHidden = true, UIPrerenderedIcon = true, -- set to false for "shine" overlay, UIAppFonts =             {                 "i\_fink\_u\_freeky.ttf"             }, CFBundleIconFile = "Icon.png", CFBundleIconFiles = {                 "Icon.png",                  "Icon@2x.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-40@3x.png",                 "Icon-Small-50.png",                  "Icon-Small-50@2x.png", },             UILaunchImages = {                 {  -- iPhone 4 Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 480}"                 },                 {  -- iPhone 5 Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-568h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{320, 568}"                 },                 {  -- iPad Portrait                     ["UILaunchImageMinimumOSVersion"] = "7.0",                     ["UILaunchImageName"] = "Default-Portrait",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{768, 1024}"                 },                 {  -- iPhone 6 Portrait                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-667h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{375, 667}"                 },                 {  -- iPhone 6 Plus Portrait                     ["UILaunchImageMinimumOSVersion"] = "8.0",                     ["UILaunchImageName"] = "Default-736h",                     ["UILaunchImageOrientation"] = "Portrait",                     ["UILaunchImageSize"] = "{414, 736}"                 }              }, }, },     android =     {         versionCode = 8,         googlePlayGamesAppId = "20154420814",         usesPermissions =         {             "com.android.vending.BILLING",         },     }, plugins =     {         -- key is the name passed to Lua's 'require()'         ["CoronaProvider.ads.iads"] =         {             -- required             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true }         },         ["CoronaProvider.gameNetwork.apple"] =         {             publisherId = "com.coronalabs",             supportedPlatforms = { iphone=true, ["iphone-sim"]=true },         },         ["CoronaProvider.native.popup.social"] =         {             --required             publisherId = "com.coronalabs",         },         --key is the name passed to the Lua "require()"        ["CoronaProvider.gameNetwork.google"] =        {           --required!           publisherId = "com.coronalabs",           supportedPlatforms = { android=true },        },        ["plugin.google.iap.v3"] =        {           publisherId = "com.coronalabs",           supportedPlatforms = { android=true }        },        ["plugin.google.play.services"] =        {           publisherId = "com.coronalabs",           supportedPlatforms = { android=true }        },     } }

You can make a call to system.getInfo( “androidAppPackageName” ) to retrieve the package name used in your Android app and display/print it for verification purposes.

https://docs.coronalabs.com/daily/api/library/system/getInfo.html

Hey Tom,

Thanks for the tip.  I tested the above call and I can see that the change is reflected to whatever I type in the package text field of the build console.

I installed the .apk file onto my device (not via Google Play) using the package name com.enormacegames.goballistic (which is the same as google play) and Game Services works like a charm :slight_smile:

So that is great.

However the issue is that if I upload this same .apk file into Google Play it still expects the package name to be:

com.gmail.rozental.norman.Go_Ballistic

(See screenshot above for the error).  How would Google Play know of this package name?  It must be referenced in the .apk package perhaps?

I even used the aapt tool to find out the package name and the package name is correct.  The .apk file contains the package name com.enormacegames.goballistic as expected.

All the URLs in Google Play have the package name ‘com.gmail.rozental…’ so it looks like this was created from the original .apk file I uploaded a couple of weeks ago.

As a test I created a new application and uploaded the .apk (with the package name com.enormacegames.goballistic) and it worked.

Sigh…

So I might have to add / upload all the content again using the new application… :frowning:

When you created the app on Google Play you told it what name you were going to use.  That’s the name you have to use when you submit to Google.  Did you submit it once with one package name and then decide to change the name?

Rob

Hi Rob,

I’ve always had the same package name but only needed to change it because the package name text field in the Google Play -> Game Services -> Linked Apps is: com.enormacegames.goballistic

I’m assuming I added that myself when I first created the Game Services.  And this can’t be changed.  It’s read only.

The issue appears to be the URL for the game in Google Play contains the other package name (com.gmail.rozental.norman.Go_Ballistic) that must have been generated when I first uploaded my .apk file.

And that is why I get the error when uploading a .apk file with the package name com.enormacegames.goballistic

Please note: com.gmail.rozental.norman.Go_Ballistic was auto generated by Corona and I should have changed it accordingly.

They have to match, so creating a new Google Play app using the same package name that you used for GPGS is required.

Rob

Yep, in the process of doing that.  Thanks again Rob and Tom.