I’m testing in Android emulator with Play Store access using a testing account so no actual money is being charged. I am able to purchase products and packages, but not able to test changing packages using the UpgradeInfo docs. What could the issue be with Play Store or is there some other configuration I need to make somewhere?
When I select the package to change to I see the following, which all looks correct in my logs. The SKU is found and the Flutter purchases_flutter package is clearly showing everything good to go at this point.
D/>Purchases] - DEBUG(25398): Vending Offerings from cache
D/hPurchases] - DEBUG(25398): Product change started: com.revenuecat.purchases.models.ProductDetails@1e0bf2c4 - offering: packages UpgradeInfo: UpgradeInfo(oldSku=package_3.99_monthly, prorationMode=1)
D/MPurchases] - DEBUG(25398): Querying Purchase with package_3.99_monthly and type SUBS
D/dPurchases] - DEBUG(25398): Checking if cache is stale AppInBackground false
D/aPurchases] - DEBUG(25398): Found existing purchase for SKU: package_3.99_monthly
D/cPurchases] - DEBUG(25398): Moving from old SKU package_3.99_monthly to sku package_39.95_yearly
However, I then see this on the screen:
And then in the logs after clicking OK:
W/ProxyBillingActivity(25398): Activity finished with resultCode 0 and billing's responseCode: 2
W/BillingHelper(25398): Couldn't find purchase lists, trying to find single data.
W/BillingHelper(25398): Received a bad purchase data.
W/BillingHelper(25398): Couldn't find single purchase data as well.
W/BillingHelper(25398): Couldn't find purchase lists, trying to find single data.
W/BillingHelper(25398): Received a bad purchase data.
W/BillingHelper(25398): Couldn't find single purchase data as well.
E/pPurchases] - ERROR(25398): BillingWrapper purchases failed to update: DebugMessage: . ErrorCode: SERVICE_UNAVAILABLE.null
E/oPurchases] - ERROR(25398): There was a problem with the Play Store.
I/flutter (25398): PlatformException(2, There was a problem with the Play Store., {code: 2, message: There was a problem with the Play Store., readableErrorCode: StoreProblemError, readable_error_code: StoreProblemError, underlyingErrorMessage: Error updating purchases. DebugMessage: . ErrorCode: SERVICE_UNAVAILABLE., userCancelled: false}, null)
This is my Flutter code:
await Purchases.purchasePackage(
myProductListrindex],
upgradeInfo: UpgradeInfo(
subscriptionTypeString ==
monthlySubscriptionString
? yearlySubscriptionSKU
: monthlySubscriptionSKU,
prorationMode: ProrationMode
.immediateWithTimeProration,
),
);