I have been trying to test the purchasing of Play store subscriptions on my device, but I have not succeeded despite following several step-by-step guides[1][2][3].
My ultmate aim is to test subscriptions on my USB connected device by building and installing the app with Android Studio. Unfortunately, it seems my only option right now is to to publish the app to the Alpha track on the Play Store, wait a few hours and download it every time I make a change.
The subscription products are queried successfully using BillingClient.querySkuDetailsAsync, but when I launch the billing flow (via BillingClient.launchBillingFlow) I see the following alert on the screen:
Error
This version of the application is not configured for billing through Google Play. Check the help centre for more information.
OK
I also see the following in the console:
W/ProxyBillingActivity: Activity finished with resultCode 0 and billing's responseCode: 5
W/BillingHelper: Couldn't find purchase lists, trying to find single data.
W/BillingHelper: Received a bad purchase data.
Couldn't find single purchase data as well.
The response code 5 indicates a developer error:
Invalid arguments provided to the API. This error can also indicate that the application was not correctly signed or properly set up for In-app Billing in Google Play, or does not have the necessary permissions in its manifest.
My app is published to Internal, Alpha and Beta release tracks with the same version name and version code as the locally built APK. In the Play console, I have created a License Tester and added it to the Alpha track's testers, then opted the tester in to the Alpha track via a link. On my device, I am logged in with the tester's Google account.
I have tried building an APK signed with the release certificate, with a matching version name & code to the APK published in the store. I was at first using the "Run" and "Debug" buttons in Android Studio, but discovered that they built an unsigned[7] APK no matter how I configured the signing configs. Instead, I build using the Build->Make Project menu item, and install the resulting signed APK using ADB[5]. The "Active Build Variant" is set to "Release".
It occurred to me that it may be impossible to sign a locally built APK with the same key as the APK distributed by the Play store, as my app has "Play App Signing" enabled (which causes Google to re-sign the APK using a different key, which is inaccessible to me). However, there is a thread on StackOverflow which suggests other have had success even when using Play App Signing[6].
I have also tried waiting several days between publishing a new build to the Alpha track and trying to purchase a subscription, as I read that the Play Store sometimes takes up to 24 hours to process builds.
I am using Android Studio 4.2 on MacOS 10.15.7, with a Samsung A5 phone for testing.
[1] Selling subscriptions
[2] Testing in-app purchases on Android
[3] Checklist on Stack overflow
[4] "Run" with signed APK
[5] Install an APK via ADB
[6] Testing In-App payments with Play App Signing enabled
[7] Verifying an APK is signed
Update 2022
I never found workaround for this on my Samsung A5 running Android 8. However, I purchased a Samsung A52 (running Android 12) and it does not exhibit this problem.
you need to increase the version and upload that version as beta publish.
mostly duplication
please check This version of the application is not configured for billing through Google Play
If two apps differ in the signing key or in the package, then Google Play considers them different applications
Both debug & release versions should use the same signing key, I can make test purchases while debugging via USB on Android Studio with no problemas
something like this on the app build.gradle :
buildTypes {
release {
signingConfig signingConfigs.mykey
debuggable false;
....
}
debug {
debuggable true
signingConfig signingConfigs.mykey
....
}
}
There's a utility called "lucky patcher" which modifies app code in order to allow for bypassing in app purchases (yes, it's used for piracy, but I'm pretty sure it's not piracy to bypass your own app). You could try using it to test your app.
And in case you haven't already, once you're done, protect against it by following this: Lucky patcher, how can I protect from it?
Related
I already have a production app on play store,
now I have uploaded the next release version on internal testing track,
I have created a mailing list with team testers, but now all the tester of my team see the test version and they cannot choose between production version and test version. Is there a way to choose between the two version ?
How can the tester chooses between production app and the testing version ?
Moreover I'm wondering which is the difference between Android play console internal testing and closed testing ?
End users (or testers) cannot choose which version they want, they will always receive the APK/AAB with the highest versionCode that they are eligible for.
If users receive the APK from a testing track and want to go back to the production one, they have to opt out of the testing then reinstall the app (since Android will never downgrade an app) or wait for the next production push.
when we try to update our compiled app over the old app(installed from amazon store) on Kindle, we get this error:
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
We have verified versionCode that increased, the package name is the same. We think we signed with the same key.
Could please anyone help me? I am new to Android though.
I saw this same error message when attempting to test the upgrade process of our application on Kindle devices accessing the Amazon App Store. I was locally building and signing the app and deploying via $ adb. I ensured that the build configuration was the same (i.e. -release) and that the version number had been incremented properly, but I was still receiving the error upon installation until the application was completely uninstalled. Forcing our users to uninstall for the upgrade was not an acceptable delivery mechanism.
Strangely, the issue did not occur when testing the same process on Samsung devices accessing the Google Play store. The source of the issue for me turned out to be the fact that Amazon removes your developer signing from uploaded .apk files and re-signs your built application with a different key store. Once our update got accepted for publishing, we were able to confirm that the upgrade worked as expected without having to uninstall the app.
I can't test subscriptions in my signed debug version, error:
Only works when I download the app straight from the store,
I have already done all these steps:
1 - The App is published in alpha;
2 - A test account is already registered on play console (Configurations);
3 - SKUs are already registered in play Console;
4 - Debug version code is same as store version;
5 - In Manifext android:debuggable="true" and in gradle release variant "debuggable true"
This is my first experience with Google Play Billing. I've been striving to follow the documentation steps https://developer.android.com/google/play/billing/billing_testing, however some steps are not very clear :(
I'd like some help understanding what I'm still doing wrong, as it won't be productive for me to test on the store app.
I am trying to purchase using a beta tester but i am getting this error.
This is an error that shows in google play window, after passing initial validations and after the user press subscribe button, so i guess it is not an code or configuration error.
Anyway i checked this link https://stackoverflow.com/a/22469253/2700303 and also downloaded the app from the store.
I check the "Learn more" link that comes with the error but nothing on that troubleshooting page helped.
The account used as a valid and active pay method.
I am running on a simulator, but google play comes with it for a reason, so i discard that also.
The rest of the suggestions say to use other device. My simulator is running API 28 so should be good enough.
In-app purchase must be tested with production build on real device.
Steps
Generate release build from Android studio.
Uninstall debug app from your device, or use adb uninstall.
adb uninstall {yourdomain}.{yourpackagename}
Install your release version to your device.
adb install app-release.apk
Update:
Check this answer for more details.
Update 2 :Please read more about Test Google Play Billing
I was having problems earlier implementing in-app billing for android. I have fixed that issue, but following that is another issue. When I run the application on my phone and another test account phone, I get the error: "This version of the application is not configured for Market billing." I have installed the new version of the app to the Android market as an APK and added the items. When it opens the in-app billing, it shows the name of the item to purchase from the Android market, but gives me the error. When I tried the static example from Google, that worked.
Thanks
To get this to work you need to sign the package with your release key/certificate, upload to the Market and save it (without activating). Then install the release APK to your device to be able to test. The APK you install on the phone has to have the same version and be signed with the same certificate for IAB testing to work. Details here.