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!
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
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" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With