-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RemoteException handling not supported #52
Comments
+1 for this |
+1; without this patch the billing library is unable to recover from crash, which I observed on Galaxy Nexus JB 4.1.1 factory ROM |
This should really be labeled as a bug and not a feature. The play store will randomly exit and then your app is stranded with a bad reference that won't get removed until the your app is killed. I opted to catch the RemoteException in runPendingRequests and then rebind the service. This seems to seamlessly rebind and launch the play store without showing an error. private void runPendingRequests() {
BillingRequest request;
int maxStartId = -1;
while ((request = mPendingRequests.peek()) != null) {
if (mService != null) {
try {
runRequest(request);
mPendingRequests.remove();
if (maxStartId < request.getStartId()) {
maxStartId = request.getStartId();
}
} catch (RemoteException re) {
rebindMarketBillingService();
return;
}
} else {
bindMarketBillingService();
return;
}
}
if (maxStartId >= 0) {
stopSelf(maxStartId);
}
} private void rebindMarketBillingService() {
try {
unbindService(this);
} catch (Exception ignore) { }
mService = null;
bindMarketBillingService();
} |
@jgilbert42 Re-labeled. Will be fixed in the next update. |
i would like to add the question: why does it crash, first hand? because i can report that remote exception been thrown / that crash happening on a motorola droid with android 2.1 where the market version is 2002306 - which i do not know what /normal/ market version number fits. 3.06 ? 2.306 ?? and the situation is that isBillingSupported properly returns with support, and the crash appears as soon as i try to requestPurchase. there is a mobile connection present, and the device & market have been previously used. so why does it crash? any ideas? because, if i use any of the above mentioned fixes, i guess the crash will just appear over and over? |
okay, i have the remotexception (BillingService.runRequest() line 260) been thrown on every device. i googled and hoped it would be a stupid standard mistake, but couldnt find it. as far as i know i follow the typical test steps. the funny thing is, if i do not have connection (wifi + 3g off) then i still get the exception (instead of a "not connected" when i try to purchase my own stuff), if i requestPurchase() on a static response then it works properly (either telling me "not connected" or when connected does what it should, for example the static cancel response returning cancel) does anybody have an idea what i missed? |
@ludocrazy Can you reproduce the problem with my fork too (or by applying hpique@a625937)? |
i will try, but if i repress the button in my GUI to retry, then it crashes EVERY TIME. so what should your code help, besides endlessly trying? did i miss something reading the code change you linked? i'm new to github, i do not understand how i can get the files from your pull request. what keywords do i google to learn / understand that? or can you explain it without taking tomuch of your time? thx! |
I'm running into this issue on Galaxy Nexus Android 4.1.1, running app directly from eclipse (debug signed) with developer account on phone. I see that hpique and jgilbert42 both have solutions, but nothing has been released. Should I implement one of these solutions or is this something that only occurs using debug signed app or what? |
+1. My users encountered similar behavior. |
Why this issue is closed? The library has the same error and the same wrong code still. |
+1 for suggested improvements - without them this library is useless because it often prevents user from buying products. |
Hi,
I have a test-case where I simulate that the market is stopped in an purchase:
The current implementation in BillingService.java looks like this:
So the question here is how to handle: "//TODO: Retry?"
Here is my suggestion in code, don't know if anyone else have a better fix or suggestion how to handle this?
Suggested improvements:
BillingService.java:
BillingController.java
So then for the retry this can be up to the actual individual implementation to handle in my case I use the the "onRequestPurchaseResponse" callback and in case for ResponseCode.RESULT_ERROR I just perform a BillingController.checkBillingSupported(applicationContext).
The text was updated successfully, but these errors were encountered: