16

Using com.android.vending.licensing you can check if your app is licensed or not. There is a callback, applicationError() that tells you if anything went wrong. Today I encountered error ERROR_NOT_MARKET_MANAGED and I can't figure out how I should deal with it!

Here's what I did:

  1. On Google Play, I added my e-mail address as a test account.
  2. On Google Play, I saved my app (unpublished) with versionCode="10".
  3. On my machine, I changed to versionCode="11".
  4. License check now fails with error code ERROR_NOT_MARKET_MANAGED.

The question is; should I handle this error or is this an unrealistic scenario?

Deduplicator
  • 44,692
  • 7
  • 66
  • 118
l33t
  • 18,692
  • 16
  • 103
  • 180
  • Google suggests managing the error by calling dontAllow() method: `Additionally, you should implement the applicationError() method, which the LVL calls to let your application handle errors that are not retryable. You can implement the method in any way needed. In most cases, the method should log the error code and call dontAllow().` – Borzh Dec 01 '19 at 16:40

5 Answers5

31

ERROR_NOT_MARKET_MANAGED: the name really tells all about itself, application is not managed by Android Market (now called Google Play). More specifically, the version 11 of your application is not uploaded or published in Google Play.

should I handle this error or is this an unrealistic scenario?

I would consider this as an unrealistic scenario. You don't need to do anything special in code as long as you upload the new app version in Google Play. ERROR_NOT_MARKET_MANAGED is more like a LVL development warning which help developer properly implement license checking code and follow the correct procedure for testing license checking at project build time. check out the comments in LVL sample code:

private class MyLicenseCheckerCallback implements LicenseCheckerCallback {

    ... ...

    public void applicationError(ApplicationErrorCode errorCode) {
        if (isFinishing()) {
            // Don't update UI if Activity is finishing.
            return;
        }
        // This is a polite way of saying the developer made a mistake
        // while setting up or calling the license checker library.
        // Please examine the error code and fix the error.
        //String result = String.format(getString(R.string.application_error), errorCode);
        //String result = "Error";
        //handleLicensingResult(result);
    }
}

The whole point of integrating LVL into your application is to use Google Play publish your application, and use Google Play client application download and install your application (see Requirements and Limitations section in dev guide). I can't see any point that can cause this applicationError at runtime on end user's device if:

  1. Developer follow the correct procedure to upload (for testing LVL) or publish (for real release) in Google Play.
  2. End user use Google Play client application purchase, download and install the application.

If a end user somehow get a copy of your application (with LVL integrated and uploaded/published in Google Play) from other channel (not purchase via Google Play) and trying to install it on his device (with Google Play client application installed on that device), in this case, LicenseCheckerCallback will go to dontAllow() rather than applicationError(ApplicationErrorCode errorCode).

yorkw
  • 40,926
  • 10
  • 117
  • 130
  • Seems this error is not mandatory. I have been making apps for more than two years now and I have only seen this error when running my apps on a SamsungGalaxy S2 with ICS. – slott Aug 20 '12 at 05:34
  • @yorkw, if you download the APK directly from Google Play via a tool http://apkleecher.com, then you still could be able to run this apk file on simulator (with Google Play) and it works fine, neither entering dontAllow nor applicationError. – LiangWang Feb 02 '16 at 06:47
  • This is also a polite way to say that Google made a mistake. I get this error on older devices but it works as it should on newer ones. – Dpedrinha Sep 06 '17 at 00:46
13

Dont test your application immediately after you upload it to Google Play.

Wait for some time (15-20 mins or probably longer) before you start testing. Google play takes some time to recognize your app.

iwein
  • 25,788
  • 10
  • 70
  • 111
Rakesh Patil
  • 370
  • 4
  • 12
  • 4
    I think this is caused by the cached data of stock Google Play Store app on your phone, By clearing data and/or cache (Settings - Applications - Google Play Store), I can test and get the license status change immediately. – yorkw Dec 02 '12 at 02:02
  • Or better yet, get a hardware device, reset it to factory, then set it's primary user account to the dev account you uploaded the APK to. – logray Dec 02 '12 at 05:23
  • 1
    For me it took more than an hour... I thought I was doing something wrong, but it seems one just needs to be patient sometimes. – neon1 Mar 22 '13 at 17:18
  • 1
    I can verify that @yorkw method of clearing data/cache worked for me. – Josh Aug 18 '13 at 13:50
2

29 Jul, I have found that while my app is in Alpha or Beta testing all I ever get is Error 3 or Error_Not_Market_Managed. This is actually a reply from the server. SO that means that I am touching the server and the code is good. Regardless of what is set in the Developer Console as a reply, this is the only reply that I get.

I have actually waited 3 days and there is no change. SO there is no wait time which is acceptable. I even cleared and reset my entire phone. I cleared Google Play cache and all of the other magic tricks. None of them were the reason.

I updated one of my already published apps with my new Google License code and got the exact same response. After I changed the version code and then uploaded it to be published, about 4 hours later, that app functioned normally and the Google license check responded with a good valid code. Now as long as it is fully published, it responds with what ever code I tell it to.

SO the answer is, Google License will not function properly until fully published. If your app is in Alpha or Beta and you are getting Error 3 then you are likely good. Just comment out the License Check method until you are ready to publish.

  • If your app has a `versionCode` that is not present (published or unpublished) on Google Play, all errors should be discarded. My original question actually contains the right answer; it's an unrealistic scenario. – l33t Jul 29 '14 at 12:19
  • “ After I changed the version code and then uploaded it to be published, about 4 hours later, that app functioned normally”, maybe it is because you have changed the version code? And I have the same problem with you while I still think beta test should be OK. – LiangWang Feb 02 '16 at 06:52
1

As for now, 2014 May, I have to publish the testing app (no production APK uploaded) in order to test the uploaded APK and expansion OBB in beta. Otherwise, I always got ERROR_NOT_MARKET_MANAGED when testing APKExpansionPolicy. And 2 hours after publish (the notice on webpage said "up to 24 hours"), I can get expansion file information.

No one except testers can see the published app AFAIK.

lk_vc
  • 1,136
  • 20
  • 26
0

It also can happen in older devices. I'm testing my app without the actual version being published and it works fine on my Galaxy S8, but I get this message on my Galaxy S4. Which means it's also a polite way to say that this can also be a mistake from Google.

Dpedrinha
  • 3,741
  • 3
  • 38
  • 57