demon99 / marketbilling

Automatically exported from code.google.com/p/marketbilling
0 stars 0 forks source link

serviceIntent.setPackage crashes emulator #153

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
STEPS TO REPRODUCE:
1. Upgrade to latest marketbilling version (from Oct 8, 2013)
2. onCreate: Initialize IAB
3. Launch Emulator

EXPECTED OUTPUT: App works in emulator (even though IAB does not, of course)

ACTUAL OUTPUT: Emulator crashes: NPE on IabHelper.startSetup(IabHelper.java:267)

Workaround: I commented the line out, now everything works as before:

// serviceIntent.setPackage("com.android.vending");

Original issue reported on code.google.com by sleepybu...@gmail.com on 21 Oct 2013 at 7:58

GoogleCodeExporter commented 8 years ago
I experienced the same problem, and also found that either commenting out the 
line, or setting the package to null, solved the NPE problem.

What I was wondering, however, is: what it the appropriate value to set the 
package to.  I tried setting it to the package name of my app 
(ca.ewert.android.pwMinder), but when I tried this, my In-App Billing requests 
failed with: BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE.

So, I can work around this, by setting the package to null, but is this a 
security concern?  If so, what package name should I use.

NOTE: I have the marketbilling sample code (including IabHelper) in a package 
called: com.android.vending.billing.util, with the IInAppBillingService.aidl in 
com.android.vending.billing

Original comment by vew...@gmail.com on 23 Oct 2013 at 8:11

GoogleCodeExporter commented 8 years ago
You have to leave the package as-is. But see Issue 149 for a solution - 
queryIntentServices can return null.

Original comment by marko.st...@outfit7.com on 25 Oct 2013 at 11:40

GoogleCodeExporter commented 8 years ago
Thanks for the tips, I got it working now.

Original comment by vew...@gmail.com on 28 Oct 2013 at 4:23