0

Since I have updated my phone to the Lollipop version of Android, my applications crash when they try to check the Google license (call to checkAccess). The error message is :

"java.lang.IllegalArgumentException: Service intent must be explicit: Intent {act=com.android.vending.licensing.ILicenseService".

The code I use is :

myLicenseChecker=new LicenseChecker(myActivity,new ServerManagedPolicy(myActivity,new AESObfuscator(salt,myActivity.getPackageName(),identificationMatériel)),myPublicKey);
myResponseAnalyzer=new MyResponseAnalyzer();
myLicenseChecker.checkAccess(myResponseAnalyzer);

I have added the "com.android.vending.CHECK_LICENSE" permission in the manifest file but it had no effect at all.

What could be the cause of the generated error?

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
VD63
  • 133
  • 1
  • 9
  • possible duplicate of [Google In-App billing, IllegalArgumentException: Service Intent must be explicit, after upgrading to Android L Dev Preview](http://stackoverflow.com/questions/24480069/google-in-app-billing-illegalargumentexception-service-intent-must-be-explicit) – rds Aug 14 '15 at 18:48

1 Answers1

1

It's a known Licensing Library bug.

Reported solution:

As I put a few hours ago at issue 1674 , another working solution is:

Intent serviceIntent = new Intent(
         new String(Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
         serviceIntent.setPackage("com.android.vending");

         boolean bindResult = mContext
                 .bindService(
                   serviceIntent,
                   this, // ServiceConnection.
                   Context.BIND_AUTO_CREATE);

Bug report with solution above.

Community
  • 1
  • 1
atastrumf
  • 183
  • 1
  • 7