Open GoogleCodeExporter opened 8 years ago
Hi I got it too... and I've a lot of crash because of this error.
Can you please add some fix?
This error seems to affect the whole user base (no version, carrier or device
specific)
Original comment by stermi
on 11 Nov 2013 at 2:01
Anyway I think that you can simply make a little fix with a null check.
Take a look at this code: https://gist.github.com/StErMi/7413653
Original comment by stermi
on 11 Nov 2013 at 2:05
Thanks! But where "InappHelper.setInappSupported"? Anything in google about
even setInappSupported method. InappHelper != IabHelper :\
Original comment by semt...@gmail.com
on 18 Nov 2013 at 8:23
Uops #3 my bad I've updated the code :)
InappHelper is my own helper :)
Original comment by stermi
on 19 Nov 2013 at 2:25
PackageManager.queryIntentServices() never returns null.
(http://developer.android.com/reference/android/content/pm/PackageManager.html#q
ueryIntentServices(android.content.Intent, int))
I think the problem is that mContext somehow becomes null and that's why the
NullPointerException.
I'm suddenly receiving a lot of these crashes from all types of devices. If
anyone has a good fix, please share.
Original comment by catalin....@gmail.com
on 2 Dec 2013 at 9:38
I have a similar problem as well. Adding a null check resolved the problem for
me.
Intent serviceIntent = new
Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
PackageManager pkgManager = mContext.getPackageManager();
List<ResolveInfo> intentServices =
pkgManager.queryIntentServices(serviceIntent, 0);
if (intentServices != null && intentServices.isEmpty() == false)
{
// service available to handle that Intent
mContext.bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
}
else
{
// no service available to handle that Intent
if (listener != null)
{
listener.onIabSetupFinished(new IabResult(BILLING_RESPONSE_RESULT_BILLING_UNAVAILABLE,
"Billing service unavailable on device."));
}
}
Original comment by nwmotog...@gmail.com
on 7 May 2014 at 5:37
By the way, the documentation for queryIntentServices() method says that if no
result found, an empty list is returned, but in fact we have null very often
for that method.
Original comment by Anastasi...@gmail.com
on 8 May 2014 at 8:45
PackageManager.queryIntentServices() really may return null on android 2.3.3.
Test IAB in emulator without google play.
Original comment by viliam.d...@gmail.com
on 4 Jul 2014 at 9:03
Original issue reported on code.google.com by
huster.z...@gmail.com
on 7 Nov 2013 at 4:03