SecurityException neither user nor current process has com.android.vending.CHECK_LICENSE

I’ve had two users reporting that they can no longer start my app, they are getting

Runtime Error

java.lang.SecurityException: Neither user 10110 nor current process has com.android.vending.CHECK_LICENSE.

The user number is different for each person who has reported it as would be expected.

The app is built using the latest public release 2017.3068. The line of code causing the problem is

licensing.verify( licensingListener ). Licensing.init has been called and my build settings has “com.android.vending.CHECK_LICENSE” and “com.android.vending.BILLING”

I have just over 20,000 users of my apps, each app has the same licensing check code. I’ve never had this come up before over a fair few years now, but suddenly i get two users report it a day apart. The two users are having problems with the same app, this particular app (9000 users) is running the latest public build, but i dont think any of the other apps are, they would be on the previous public build or possibly even earlier. 

Both users are running Android 4.0.4, one of them has hard reset his tablet and the problem still remains after reinstalling it. The other user has multiple devices, one is having this issue, the other is not, same google play account. The devices affected are different for each user.

I’ve googled this particular error, and most indicate this can happen when Google Play is not installed, however both my users definitely have it installed on their devices.

I’m not really sure where to go from here, I’ve run out of ideas as to what could be causing this issue which is why I’ve posted here for help.

On a related note, the licensing doco for 2017.3068 indicates that licensing.init is supposed to return true on success, otherwise false. In my testing here, it always returns false for me on my tablet, however licensing.verify works fine if i call it anyway. Verify gives me the correct result (as per the settings in my portal for the alpha/beta app license check responses) so it is working. I tested verify against all the different license validation responses you can set in the portal to make sure it was working.

Also, just been going over my emails again. One of the users had actually been using the app fine on his device for a few days prior to the problem, then it just starting having this error on startup from Sat 22nd July. 

Hi @cjorgens79. This is an odd problem to say the least.

When was the last time you did a build on this app and published it for customers?

What plugins are you using?

Thanks

Rob

One customer is on my current release apk from 30th April, the other i got to also try my latest alpha build from 17th July and they still had the same issue. 

My plugins are

    plugins =

    {

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

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true }

        },

        [“plugin.pasteboard”] =

        {

            publisherId = “com.coronalabs”,

        },

   }

Not good, i just had another user who has had one of my other apps for 2 years report that he can no longer run it, he is getting the same error. The app in this case was last updated Feb 21st. 

Something seems to be going on with Google Play that is causing this for some users. How does the licensing.verify command work exactly, what would be causing this type of exception to occur?

Edit: FYI the latest user with the problem is also running Android 4.0.4, so that is the only common factor so far.

Can you try and put together a small test app that just has your license code in it and send it in as a bug report. It will need a main.lua, config.lua (with your license code) and build.settings in addition any assets and zip it up and send it to us.  Maybe you can also build a .apk and see if your people having the problem install it and see if it reproduces there.

Also do you have device models of the devices that are failing? We need as much information as you can round up.

FWIW, it may not be your licensing calls that are causing the problem. It could be IAP. IAP needs the license code in your config.lua, but I don’t believe you have to call licensing yourself for IAP to work. The licensing.* API’s are just for you to know if your app has been hacked.

You could also do a custom build without the licensing calls and upload it as an Alpha or Beta and add the people with problems as testers and rule out the licensing code.

Rob

Ok will do, im about to head to bed so will get it to you tomorrow.

The info i was given from the customers with the problem devices is

Samsung Galaxy Tab 10.1 Samsung GT-P7510 (one of the first tablet of the brand)

Android: 4.0.4

Google Play Store version 8.0.26.R-all [0] [PR] 161173660

MOTOROLA XOOM

Anrdoid 4.0.4

Google Play Store 8.0.27.R-all

Samsung tablet

Anrdoid 4.0.4

Google Play Store 8.0.26.r 

I have submitted a bug report with code matching the code causing the issue, report id 10097060

My customer has confirmed that they get the same runtime error with the test application i submitted with the bug report. 

screenshot of full error message

https://1drv.ms/i/s!ApGj0SbKlZGjgzdKVDpOkMr1FEJ5

What is also interesting is that i created an updated build of my main app with a runtime exception handler to try and catch the licensing.verify error and handle it, however it does not appear to be getting caught. I did the following

– unhandled exception catcher

local unhandledErrorListener = function( event )

    if ( string.find(event.errorMessage, “CHECK_LICENSE”) ~= nil ) then

        print(event.errorMessage)

        print(event.stackTrace)

        return true

    end

    

    return false

end

Runtime:addEventListener( “unhandledError”, unhandledErrorListener )

The customer said they were still getting the same error message as always, so it appears this did not get fired. The runtime error listener was added before the licensing calls were made.

On a related note, when i created my test application in Google Play it prompted me to “Enrol your app in Google Play app signing” (https://support.google.com/googleplay/android-developer/answer/7384423). Its been a while since i created a brand new app, looking into it further it seems like existing apps can be changed to also use this.

My question though is does this “google play app signing” replace the need for licensing.verify? I couldn’t find anything that clearly explained its purpose.

To the “Enroll your app in Google Play app signing” part, Google is moving to a new way to sign apps. If you signed with a release keystore you should be fine. At some point people will probably want to go to Google’s new way of signing but I don’t believe it’s required yet.

I saw the bug report come in. I don’t have a 4.0.4 device to test it on. We will see if we can find one to work with.

Rob

For some reason i didnt get an email notification about your last post, so i have only just seen it.

Did you manage to find a 4.0.4 device to try it with?

Thanks,

Craig

Do you still have the email where you filed the bug report and got the confirmation? If so it will be best to reply to that to get an update. 

Rob

I’m having the same problem with daily build 3172.

Error is on composer.lua line1453 with this build. I definitely added com.android.vending.CHECK_LICENSE to my build.settings and my key to config.lua. Implemented the tutorial codes only under gameLeaderboards example.

Any luck with solving this bug?

p.s: Also enabled both Drive API and Google Play Developer API

That composer error is saying you have an error in the scene you’re trying to go to or the scene doesn’t exist.

Rob

Hi Rob,

Sorry for the late reply. Scene name and other piece of codes are correct. because whenever I delete licensing.init  function, my app is working. I am just using the sample code given in licensing guide.

Simulator says licensing is not allowed in simulator but rest of the code can run in that scene. When I deploy it to my test device, app does not start even. As I said, deleting licensing.init(“google”) lets the app run, but then I can’t use the licensing functionality.

Thanks.

Have you looked in your device’s console.log using “adb logcat”?

Rob

Also, just been going over my emails again. One of the users had actually been using the app fine on his device for a few days prior to the problem, then it just starting having this error on startup from Sat 22nd July. 

Hi @cjorgens79. This is an odd problem to say the least.

When was the last time you did a build on this app and published it for customers?

What plugins are you using?

Thanks

Rob

One customer is on my current release apk from 30th April, the other i got to also try my latest alpha build from 17th July and they still had the same issue. 

My plugins are

    plugins =

    {

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

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { android=true }

        },

        [“plugin.pasteboard”] =

        {

            publisherId = “com.coronalabs”,

        },

   }