Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Release vs debug build differences in Android

All, we are facing a weird issue where our app is working fine in a debug build variant. But it is failing to execute properly on a release build variant. The even weird thing is that if we set debuggable to true for the release build variant, it works fine. Proguard is disabled in both variants.

Im trying to understand what is the difference between the release and debug build variants in android. could you point me to any resources which helps me to understand the differences ?

Thank you

The following works. But if i remove the debuggable, it fails to work properly. Debug build always works.

buildTypes {
    release {
        debuggable true
        signingConfig signingConfigs.release
    }
    debug {
        signingConfig signingConfigs.debug
    }
}
like image 582
onusopus Avatar asked Jun 03 '16 19:06

onusopus


1 Answers

Maybe the problem is related to the signing of the apk. If you use debuggable true then your app is signed with a generic debug keystore and everything works correctly. Conversely, if you remove it you have to provide

storeFile file("myreleasekey.keystore")
storePassword "password"
keyAlias "MyReleaseKey"
keyPassword "password"

More info here:

https://developer.android.com/studio/build/build-variants.html#build-types

like image 97
Lino Avatar answered Oct 06 '22 00:10

Lino