Reputation: 1835
I have looked at ALL related questions and none fix my issue.
My issue first started when I tested by device on my Galaxy S2 running CM12 (A lollipop version of android WITH ALL of Google Play stuff installed).
Every time I tried to check my license, there would be an exception thrown. So I Googled the exception, which is about implicit and explicit intents. So I then modified my LicenseChecker.java class file to change the bindService
intent.
I changed it to:
Intent explicit = new Intent(ILicenseService.class.getName());
explicit.setPackage("com.google.vending");
as recommended here.
I do not have Lucky Patcher installed on the device. I just found this via the Google search about the explicit intent exception.
Setting context to getApplicationContext()
DOES NOT FIX IT.
The best part is:
On my Galaxy S5 running 4.4.2, NOT CHANGING THE CODE IN LICENSECHECKER.JAVA DOES NOT CAUSE A cannot bind to service ERROR!
I do still see the warning about implicit and explicit intents, however.
So I changed the code to make the intent explicit, and it causes the "cannot bind to service" error.
What am I missing and how do I fix this so it can run on Android 5.0+? Why does Google provide code that doesn't even work with their OS?
Thanks everyone for your time! I hope someone can help me as I feel as if I tried everything.
Upvotes: 2
Views: 466
Reputation: 1835
This worked for me. Was just trying different things and this worked.
Intent explicit = new Intent(new String(Base64.decode("Y29tLmFuZHJvaWQudmVuZGluZy5saWNlbnNpbmcuSUxpY2Vuc2luZ1NlcnZpY2U=")));
explicit.setPackage("com.android.vending");
Upvotes: 1