I recently uploaded my first Kotlin-Android app to a closed testing (alpha) track in Google Play Console. The review was complete and I shared my link to some testers. Unfortunately the release bundle has major bugs that are not present in the debug APK. (the one that generates automatically when I hit "Run" in Android Studio). I checked both bundles on my device and the debug version works perfectly fine while the release is unusable? Is there anyway to debug a release version??. Or maybe create a debuggable build that mimics it's behaviour (as a release build is set to be undebugable for safety reasons...)? Is there a way to see the app logs? (or are they removed in the release build?)
I think it's important to mention that all bugs are related to Firebase actions. My Firebase project have all the needed "SHA certificate fingerprints" (SAH-1 & SHA-256 for the debug, upload & app-signing keys). Maybe another thing is missing?
Maybe the specific bugs can point to the root of the difference, so these are my 2 biggest bugs:
Did someone encounter anything like that?
Any help would be appreciated.
you can add this debuggable true
in your gradle file
release {
debuggable true
minifyEnabled false
shrinkResources false
}
this will help you debug the release version, make sure that minifyEnabled
and shrinkResources
are false
to run the Release
version of the app with the Release Keystore
use this
signingConfigs {
release {
storeFile file('file location')
storePassword 'your store password'
keyAlias 'your key alias'
keyPassword 'your key password'
}
}
and then add in the variant of release this
release{
signingConfig singingConfigs.release
}
I found the way to debug the release bundle. The problem was that the "release" build variant used the default signing key - the debug key. I had to Configure the build process to automatically sign my app with a secured key. At the end, I have the following code in my "build.gradle (:app)" file:
...
def keystorePropertiesFile = rootProject.file(<keystore.properties file location>)
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
signingConfigs {
ionce {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
...
buildTypes {
release {
...
signingConfig signingConfigs.ionce
}
}
...
}
...
(I choose to Remove signing information from my build files . If you do, pay attention to the "\" orientation in the storeFile
field as the error is not very informative. This answer helped me)
If anyone also encounter one of the two issues I mentioned, here are the solutions:
minifyEnabled true
, which changes the attributes' names to minify the code. When getting the document from Firestore it did not match the object structure and failed to load the list. The solution is in this answer .
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.