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);
}
}
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:
However I have no idea what I am doing. Ideas?