Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error report from licence checker - what does this mean?

I just followed the standard Android licence checking procedure, and recently I get these reports:

java.lang.NullPointerException
at com.google.android.vending.licensing.LicenseValidator.verify(LicenseValidator.java:99)
at com.google.android.vending.licensing.LicenseChecker$ResultListener$2.run(LicenseChecker.java:228)
at android.os.Handler.handleCallback(Handler.java:605)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.os.HandlerThread.run(HandlerThread.java:60)

What could this mean? Is this normal ? I never got this before. Since the app in question is becoming more popular - could this be an indication that someone tried to crack the app somehow to avoid paying?

Many thanks for your insights!

like image 376
user387184 Avatar asked Oct 27 '12 11:10

user387184


2 Answers

This exception is usually encountered, when the device doesn't have the Google Play app installed or there is no account registered with the default. One might get this exception when the have the old Google Market application.

You can check the issue here, as well: http://code.google.com/p/android/issues/detail?id=26722

like image 143
thursdaysDove Avatar answered Oct 30 '22 23:10

thursdaysDove


I know this is an old question but I had this error NPE on a couple of test devices and added this quick fix:

    AccountManager am = AccountManager.get(context);
    int numAccounts = am.getAccountsByType("com.google").length;

    if(numAccounts == 0) {
        noAccountDialog();
    } else {
        // Do the license check as you have an account
    }

You will need GET_ACCOUNTS permission in AndroidManifest.xml

<uses-permission android:name="android.permission.GET_ACCOUNTS" />
like image 29
philask Avatar answered Oct 31 '22 00:10

philask