简体   繁体   中英

Google Play App Signing and In App Billing Testing

I have Google Play App Signing enabled for my project, so google play is resigning my apk after upload. If i want to install my apk on the device via adb for testing in app billing, the apk has to be signed with the same key than the version in google play, but with Google Play App Signing enabled, this seems to be impossible. If i use the same apk i uploaded to google play, i get a "this version of the app is not configured for billing through google play" error when trying to purchase a product.

My question is: With Google Play App Signing enabled, how to test in app billing without upload all test versions to google play?

I was looking for the same thing. But didn't want to link another app like your answer. So here is what I did:

Even though I already added my email to the testers list, I visited the opt-in link to register my email as tester. Apparently that's also something that has to be done.

After that I downloaded the alpha app from the Play Store (link is also in opt-in page). I then tried to run it from Android Studio (signed with the upload key. I haven't checked if debug key is enough). This gives the invalid signature warning and will reinstall the app. But when the app is installed you can now test the in-app purchases.

Only licensed testers can bypass the need for matching signatures. See https://developer.android.com/google/play/billing/test

License testers can bypass this check, meaning you can sideload apps for testing, even for apps using debug builds with debug signatures without the need to upload to the new version of your app.

To fully test in app purchases with actual charges, the APK must be published to the play store in any of the test channels.

For those who are looking for a alpha testing the "Game Services", I guess, I found the solution (or a workaround).

Go to the play console ( https://play.google.com/apps/publish ) > Game Services > Linked Apps.

Here click on "Link Another App" and choose the same app while adding. At the end when you are authorizing this app, change the SHA-1 key to your apps debug key.

How to find the SHA-1 key in android studio? Go to "Gradle" tab > app > Tasks > android > double click on "signingReport".

Hope this helps. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM