Skip to content
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

api.purchaseAndDeliver sometimes fails with GooglePlayException: Your device is not compatible with this item #76

Open
paulo-raca opened this issue Dec 14, 2019 · 0 comments

Comments

@paulo-raca
Copy link
Contributor

I've copied the core logic from AppDownloadWorker in my own tool. However, a few downloads fail with GooglePlayException: Your device is not compatible with this item.

As far as I can tell, this only happened sometimes, and only when downloading com.android.chrome.

Interestingly, api.delivery() seems to works every time, without issues.

My hacky code currently looks like this:

int offerType = appDetails.getOffer(0).getOfferType();
boolean paid = appDetails.getOffer(0).getCheckoutFlowRequired();

DownloadData download;
if (paid) {
    download = api.delivery(packageName, (int)downloadVersionCode, offerType);
} else {
    try {
        download = api.purchaseAndDeliver(packageName, (int) downloadVersionCode, offerType);
    } catch (GooglePlayException e) {
        // FIXME: Sometimes api.purchaseAndDeliver fails with "GooglePlayException: Your device is not compatible with this item."
        // However api.delivery() works without problems
        download = api.delivery(packageName, (int)downloadVersionCode, offerType);
    }
}

However I have no idea what I am doing. Ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant