Closed paulo-raca closed 4 years ago
Is this an app specific, persistent problem?
I've seen it happen with multiple apps, but the problem isn't persistent -- Something like 10% of the time
Any way to reproduce this?
Thanks for looking.
I have reduced my reproduction code to this:
@RepeatedTest(100)
public void test() throws Throwable {
GooglePlayAPI api = new GooglePlayAPI(GOOGLE_ACCOUNT, GOOGLE_PASSWORD, null);
api.login();
api.checkin();
System.out.println(api + ", " + api.getAndroidID() + " " + api.getToken());
String packageName = "com.android.chrome";
GooglePlay.DocV2 appDetails = api.details(packageName).getDocV2();
int offerType = appDetails.getOffer(0).getOfferType();
boolean paid = appDetails.getOffer(0).getCheckoutFlowRequired();
DownloadData downloadData;
int versionCode = appDetails.getDetails().getAppDetails().getVersionCode();
if (paid) {
downloadData = api.delivery(packageName, versionCode, offerType);
System.out.println("api.delivery succeeded: " + downloadData);
} else {
try {
downloadData = api.purchaseAndDeliver(packageName, versionCode, offerType);
System.out.println("api.purchaseAndDeliver succeeded: " + downloadData);
} catch (GooglePlayException e) {
System.out.println("purchaseAndDeliver failed");
e.printStackTrace();
// FIXME: Sometimes api.purchaseAndDeliver fails with "GooglePlayException: Your device is not compatible with this item."
// However api.delivery() works without problems
downloadData = api.delivery(packageName, versionCode, offerType);
System.out.println("api.delivery succeeded: " + downloadData);
}
}
}
It only fails once in a while (Therefore the @RepeatedTest()
).
Don't call api.checkin() repeatedly. That's how you register a new GSF ID for a new device. Play needs a second or two for the ID to settle, so that's probably why it fails sometimes.
This is a much simplified code, on the real thing I register as lots of distinct devices (Varying the model, abi, sdk, etc) and download all variations of each app.
However, yes, I could make registration into a separate step and reuse the GSF ids. I'll try that.
Thank you!
The issue is gone now
I merged latest changes to Raccoon, but I have no idea if the fix came from your updates or from Google's servers ¯\(ツ)/¯
Thank you
The latest patch didn't touch any relevant parts.
I'm seeing this error pop up intermitently:
Any ideas?
Thank you!