I implemented google billing functional in my app. All works, but when i added flag applicationIdSuffix ".debug"
to build.gradle, billing would not work for debug builds, but my tester really needs it.
Is there any option to make it work, not removing the flag?
Google billing does not work with applicationIdSuffix ".debug" for debug builds
Asked Answered
When you use applicationIdSuffix you actually changing your applicationId. You can't use In-App Purchases with applicationId that is different from applicationId in your application added to Google Play Console.
If you want to debug purchases you need to sign your debug APK with same key that you use for release APK.
Easiest way is to add these values to the gradle.properties file:
com.yourdomain.yourapp.store=PATH_TO_KEYSTORE_FILE
com.yourdomain.yourapp.storepassword=PASSWORD_FOR_KEYSTORE_FILE
com.yourdomain.yourapp.alias=KEYSTORE_ALIAS
com.yourdomain.yourapp.aliaspassword=PASSWORD_FOR_KEYSTORE_ALIAS
And then you can add these lines to your build.gradle:
android {
...
signingConfigs {
debug {
storeFile file(project.property("com.yourdomain.yourapp.store"))
storePassword project.property("com.yourdomain.yourapp.storepassword")
keyAlias project.property("com.yourdomain.yourapp.alias")
keyPassword project.property("com.yourdomain.yourapp.aliaspassword")
}
}
}
Check requirements.
For your tester apk can be debuggable:
signedDebug {
minifyEnabled false
debuggable true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
© 2022 - 2024 — McMap. All rights reserved.
applicationId
, so it won't be able to access billing setup in market for your originalapplicationId
– Swollen