Google Play Licensing Runtime Error in Android 5.x

Hi Everybody:
 
An app I published in December seems to be experiencing a Runtime error on Android 5.0 devices that is related to the “com.android.vending” permission used for Google Play licensing checks. The error was brought to my attention by Google Play’s QA testers, who are reviewing the app for inclusion in the “Google Play for Education” store. The details they’ve given are somewhat scarce, but it seems to only impact Android 5.0 devices - but I don’t have any Android 5 devices yet, so I can’t personally replicate it. It’s worth noting that this is the first time I’ve heard of this problem, so I’m hoping that some sort of bug in Corona SDK that can be fixed in a daily build.
 
I currently require the “com.android.vending.CHECK_LICENSE” permission in my build.settings and have a properly configured “license” table in my config.lua - I’ve done this for a number of Android apps, and this is the first time I’ve had any sort of issue. One potential problem in my code is that I don’t actually call license.verify() anywhere in my app - I somehow forgot to include a licensing check before publishing (whoops). So even though I’m properly configured to run a licensing check, I don’t do anything with that ability currently. However, that didn’t cause a problem in any other (non Android 5.0) devices in my testing, or since publishing. So I still think this might be an SDK bug.
 
Here is the Runtime Error that I was given via screenshot (pasted below):
 
RUNTIME ERROR: /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/android/ndk/shell.lua:122:java.lang.IllegalArgumentException: Service Intent must be explicit: Intent {act=com.android.vending.licensing.ILicensingService}
 
 

As a short-term workaround, I think I’ll try removing all licensing-related code from my config.lua and build.settings to see if that fixes things (I wasn’t doing anything with it anyways), but I wanted to raise the issue in case it’s a bug that needs squashing. I can’t properly create a bug report since I don’t have an Android 5.0 device and therefore can’t truly reproduce the issue in the first place. 
 
Has anybody else run into any problems with Google Play licensing and Android 5.0? Any chance somebody from CL can make more sense of that error code than I can? Thanks!
 
 
-Jason

What build of Corona are you using?

I have a Nexus 7 with Android 5, and I don’t recall seeing this problem on it (I’m also using license checking). However it’s been a while since I deployed for Android, so I’ll have to have a second look just to make sure.

Nexus 7, Android 5.0.2

Corona build 2015.2550

I just tested one of my apps. I recompiled with 2015.2550 and the app successfully managed to validate the Google licensing without crashing.

One difference might be that this is an Enterprise project (compiled locally on my desktop).

I did a quick Google search and it looks like the crash could be caused by an Android app called Lucky Patcher.

Lucky Patcher is a cracking app that impersonates Google Play for license verification (and IAP) and it apparently can mess things up when run on Android 5.0

Thanks for the help, ingemar - the build of Corona used to generate the APK currently on Google Play was 2015.2533. There have been a handful of new daily builds since then, but none of the build notes mention anything about Google Play licensing. I’m doubtful that Lucky Patcher is the culprit in this case, only because I don’t imagine a Google QA tester would have cracking apps installed on their test devices (but hey - stranger things have happened).

Maybe it’s just time for me to get myself one of those Nexus 7s. :slight_smile:

Thanks,

Jason

Yeah ;). It might be worth a shot asking them if you have a direct contact. Apparently this “tool” is not compatible with Lollipop and generates this exact crash unless removed… (and the fact that I don’t get a crash with Android 5.0 does make it a bit suspicious)

It looks like Corona might be using an implicit intent instead of an explicit one when checking the license, as noted in this reddit thread:

https://www.reddit.com/r/androiddev/comments/2jspqi/got_many_recent_reports_of_license_verification/

Can a Corona rep confirm this? I have received multiple reports from customers that can’t open my app because of this. I know for a fact that 2 of them don’t use any cracking applications.

Thanks,
George

Just following up: I did get a response from my contact at Google Play, and they confirm that Lucky Patcher is not the culprit here. According to them, “It’s specifically an Android 5.0 error that is happening across multiple devices. We do not use lucky patcher since test accounts are whitelisted for license checks/we buy the apps.”

​So it looks like it’s an SDK regression-type bug related to changes in how licensing checks are handled in Lollipop, or possibly something to do with my own code, since I require the permissions for licensing but don’t actually do anything with that requirement. I have ordered a Nexus 7 so I can do some first-hand testing on a Lollipop device. Will report back once I get my hands on it and do some investigating.

I just upgraded my Nexus 7 to Lollipop and could reproduce the issue. What I ended up doing was removing the licensing in the Corona config for my project. This is not ideal, of course, but it will have to do. I tested it without licensing and it worked.

Hi @ingemar, @schroederapps, @george.faraj,

If you can accurately reproduce this as a bug, please file a bug report and emphasize that it’s a Lollipop 5.x issue in the notes for your report.

Thanks,

Brent

@All  

I have a Nexus 7 with Lollipop (5.0.2) and the Google license check works just fine.

I’m starting to wonder if this could be a build issue. My test projects are Enterprise which mean I compile locally without the need of Corona’s build servers. I always update to the latest Android build tools and I target API level 19.

Currently my Android SDK Tools are on version 24.0.2 and the Build Tools are on version 21.1.2. If this makes a difference or not, I’m not sure…

@george.faraj

Since I have an Enterprise subscription I have access to the java code for the Google license check.

I went though the code and Corona’s license check uses an explicit intent, so that’s not the problem.

Would it have been modified recently? I’m using build 2015.2534. I guess I could try upgrading.

I doubt that the code has changed recently, however it might be worth if you try with a newer version to rule it out.

@george.faraj

Just curious. Which version of Lollipop are you using? The first versions of Android 5 were quite buggy.

It’s version 5.0.1.

On my Nexus with 5.0.2 the Google Licensing check works as expected without any issues.

It would be interesting to find out why…

Finally got my Nexus 7 today, and updated it to 5.0.2. Installing my app from the Google Play store resulted in the expected bug and crash. However - side loading the app does not. I’m wondering if this is something that only impacts apps actually downloaded from Google Play (which would make sense, since that’s what the licensing check is for). 

However, oddly enough, another app I have on Google Play downloaded and ran just fine. But in that app I actually call licensing.init() and licensing.verify(), unlike the app that is experiencing the crash. Perhaps that’s the issue? I’m going to upload a new version that calls licensing.init() & licensing.verify() to Google Play and see if that fixes things. I’ll report back.

@Ingemar - were you side loading apps to test this, or were you downloading from Google Play? Given my uneven results, I’m not sure it will matter, but it looks like the issue will not present itself on side loaded apps.

@schroederapps

I have no issues with side-loaded apps or apps downloaded from the Google Play Store on my Nexus 7 with 5.0.2.

I *do* call init() and verify(), so maybe that’s the difference? I don’t know.

The app that’s live on Google Play was compiled with Corona build 2014.2393 and the side-loaded app was compiled with 2015.2552, so it doesn’t look like the issue has anything to do with newer/older versions of Corona either.

Well, I’m happy (and a little embarrassed) to report that this all seems to have been my fault. I threw in a very simple license verification (calling licensing.init() and then licensing.verify() ), uploaded that modified build to Google Play and voila! Everything works as expected on Lollipop.

I guess this is a good reminder not to include permissions or libraries that we don’t actually use. How stupid of me not to bother to include a licensing verification after taking the time to require the license permission in build.settings and register the license hash in my config.lua! But, all’s well that ends well. Thanks guys for helping me work this through.