Code Monkey home page Code Monkey logo

Comments (12)

klemensz avatar klemensz commented on September 13, 2024

+1 for this

from androidbillinglibrary.

mikeos avatar mikeos commented on September 13, 2024

+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

from androidbillinglibrary.

thisisnottheaccountyourelookingfor avatar thisisnottheaccountyourelookingfor commented on September 13, 2024

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();
    }

from androidbillinglibrary.

hpique avatar hpique commented on September 13, 2024

@jgilbert42 Re-labeled.

Will be fixed in the next update.

from androidbillinglibrary.

ludocrazy avatar ludocrazy commented on September 13, 2024

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?

from androidbillinglibrary.

ludocrazy avatar ludocrazy commented on September 13, 2024

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?

from androidbillinglibrary.

hpique avatar hpique commented on September 13, 2024

@ludocrazy Can you reproduce the problem with my fork too (or by applying hpique@a625937)?

from androidbillinglibrary.

ludocrazy avatar ludocrazy commented on September 13, 2024

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!

from androidbillinglibrary.

fraggle222 avatar fraggle222 commented on September 13, 2024

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?

from androidbillinglibrary.

nagoya0 avatar nagoya0 commented on September 13, 2024

+1. My users encountered similar behavior.

from androidbillinglibrary.

tasomaniac avatar tasomaniac commented on September 13, 2024

Why this issue is closed? The library has the same error and the same wrong code still.

from androidbillinglibrary.

konrad-g avatar konrad-g commented on September 13, 2024

+1 for suggested improvements - without them this library is useless because it often prevents user from buying products.

from androidbillinglibrary.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.