Suddenly, licensing.init( "google" ) returns FALSE

Suddenly, licensing.init( “google” ) returns FALSE which in turn causes licensing.verify not to call the listener . It was working fine, I didn’t touch the license check code and suddenly now I’m pulling my hairs out of my head. It drives me crazy because its very simple to set up and it worked in my previous App.

Yes, I have google license key in the config file and I checked it a million times to make sure it matches the Google Play console key  in services & API . Yes I have the permission in the build file.  

What are the reasons licensing.init( “google” ) would ever return false??

Wow I might actually have to release the game with no License protection :frowning:

Its frustrating because it was working. Ugh

Hi @burnsj002,

Can you please specify what “suddenly” means in this case? What build did it behave one way versus the other way? That will help us track down whether this is a regression issue.

Thanks,

Brent

Sorry “suddenly” not a technical term but more emotional. Actually I was adding the Game Center Services code for google Play. The verification was working but I couldn’t get Game Center services To log in. I realized that I put the Game Center Service code inside the isVerified condional statement. i.e the add runtime listener for that Game Center login was inside the “licensingListener( event )” callback function - so I realized that the game center services login would never be called ! So I took the Game Center code outside the license verification callback. Then everything worked ! The verification and the Game Center Login worked fine. I was added code to for achievement buttons on the menu and that when one of the build went black screen on the device . It took me a long time to figure out what was happening but I narrowed it down to liscense.init returning false. But I’m at a loss what’s happening now. I used daily build 2015.2707 I installed daily build 2015.2714 and same thing happens. The only other thing I can think of is my Lua editor would freeze and I would have to force quit my project. But I triple checked my code for verification ugh any help thanks :smiley:

Hi @burnsj002,

I’m a bit confused on how Game Center relates to Google Play Game Services. The former is Apple, but I think you’re referring to all Google stuff here, correct? Also, when did this previously work? Did it work fine in the most recent official build 2646?

Brent

Hi @burnsj002,

It might not be the solution for your case, but typically these issues are related to setup in some regard. Double check the key entered into the “config.lua” is correct (the key can be found on the Google Play Developer Console website under “Services & APIs” for that app). Each app has its own key.

Upload a test version of the APK to the Google Play store to test it. It might take about 4 hours for Google Play to sync up the app’s developer console changes too. And of course, set the Android permission “com.android.vending.CHECK_LICENSE” in the “build.settings” file.’

Hi Brent, Yeah we’re talking about Google. For some reason I thought Google called it “Game Center Services”

I added Game Center for the iOS first and everything is already approved on the Apple side. It passed review :slight_smile:

Just a couple of days ago I started to prepare it for Google Play. I use the daily build pretty regularly so I was using 2015.2707 build when I added the licensing. Unfortunately, I’ve done all those suggestions. I checked it over and over about ten times lol.

Worst case, I will just leave out the license check. I’ve been reading that it pretty much does nothing to stop pirates and it just lulls you into a false sense of security. But I want to add it – believe me I’ll keep trying to get it to work.

Aloha @ Brent,

Hmmm. I think I know what I did wrong. I’ve been bypassing uploading my .APK builds to the Google Play Console and directly installing them on the device.

Would that cause the issue?

I’ll upload a new version .APK to the beta Google Play Console then, Maybe wait for 6 hours then and test it. I have to be patient and not bypass the uploading part.

Hi @burnsj002,

Well, I can’t speak for how Google does things, but what you describe seems fairly likely that it’s the root of the problem. Keep us posted please…

Brent

@Brent, I unpublished the game then a give it a dummy title. Then I created a new app in the Games Play Console and used the actually title of the game and new package name. I started fresh with a new license key … It thought for sure this would fix the problem.
It didn’t. Liscensing.init () still FAILS
I’m working blind unless I know why It returns false. Is there anyway to find out? What are all the finite reasons it can return false? Does Liscensing.init () function Contact Google ? I mean does it contact Google before the call to verify?
Also, do you think it’s the name of my game ? Or the beta tester e-mail?

Lastly I forgot to add the license permission check in my previous App and the Liscensing.init () didn’t fail – the verification failed. The callback listener would still be called. What I’m saying is it boggles my mind why it returns false. It’s not even calling the listener callback function .

Hi @burnsj002,

Can you check out the “Licensing” sample project to see if you’re doing things any differently? I’m quite confident that our sample has been tested and confirmed to work.

CoronaSDK-XXXX > SampleCode > Monetization > Licensing

Best regards,

Brent

@Brent, thanks for your help :slight_smile:

I took  the  CoronaSDK-XXXX > SampleCode > Monetization > Licensing and made a simple project on Google Play Console and uploading the .APK file. It also fails. Ugh.

At a hunch, I compiled the same code on my MacBook Pro for Android. And now it works perfectly!! Before I was using Windows to compile the code for Android.

Does this give you any insight in what the heck went wrong?

I guess for now I will only compile for Android on my MacbookPro.

Any thoughts on this?

When I build for Android on windows the  licensing.init( “google” ) returns FALSE

same exact code,

I build for Android on my MacBook Pro licensing.init( “google” ) returns TRUE

Hi @burnsj002,

The only other things I can think of are:

– You’re not signing the APK with the same keystore that you’re using on Mac.

– You’re not targeting the “Google Play” store in the build dialog (call system.getInfo(“targetAppStore”) to see what the built APK is really running with).

– You’re not building with the same “Version code” that the last APK uploaded to Google Play uses.

Brent

Aloha @Brent,

You’re right! Somehow I switched the target app store to “GameStick”

I feel so shame. Ugh.

Thanks for all you help

Wow I might actually have to release the game with no License protection :frowning:

Its frustrating because it was working. Ugh

Hi @burnsj002,

Can you please specify what “suddenly” means in this case? What build did it behave one way versus the other way? That will help us track down whether this is a regression issue.

Thanks,

Brent

Sorry “suddenly” not a technical term but more emotional. Actually I was adding the Game Center Services code for google Play. The verification was working but I couldn’t get Game Center services To log in. I realized that I put the Game Center Service code inside the isVerified condional statement. i.e the add runtime listener for that Game Center login was inside the “licensingListener( event )” callback function - so I realized that the game center services login would never be called ! So I took the Game Center code outside the license verification callback. Then everything worked ! The verification and the Game Center Login worked fine. I was added code to for achievement buttons on the menu and that when one of the build went black screen on the device . It took me a long time to figure out what was happening but I narrowed it down to liscense.init returning false. But I’m at a loss what’s happening now. I used daily build 2015.2707 I installed daily build 2015.2714 and same thing happens. The only other thing I can think of is my Lua editor would freeze and I would have to force quit my project. But I triple checked my code for verification ugh any help thanks :smiley:

Hi @burnsj002,

I’m a bit confused on how Game Center relates to Google Play Game Services. The former is Apple, but I think you’re referring to all Google stuff here, correct? Also, when did this previously work? Did it work fine in the most recent official build 2646?

Brent

Hi @burnsj002,

It might not be the solution for your case, but typically these issues are related to setup in some regard. Double check the key entered into the “config.lua” is correct (the key can be found on the Google Play Developer Console website under “Services & APIs” for that app). Each app has its own key.

Upload a test version of the APK to the Google Play store to test it. It might take about 4 hours for Google Play to sync up the app’s developer console changes too. And of course, set the Android permission “com.android.vending.CHECK_LICENSE” in the “build.settings” file.’