I have added gradle build to Android app, and can launch from Android Studio.
gradlew build
produces debug and released (signed, minified with proguard) versions.
buildTypes {
debug {
zipAlignEnabled true
versionNameSuffix "-" + buildDateTime()
}
release {
minifyEnabled true
// Eclipse project.properties # proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-project.txt'
zipAlignEnabled true
signingConfig signingConfigs.release
versionNameSuffix "-" + buildDateTime()
}
But when I adb install
on device the release version it crashes on start.
How can I run/debug release version of app from Android Studio to find exact place of problem?
Or can I debug manually released signed apk in Eclipse?
It means you have to give sign build in debug version also in build gradle. So It will have the same sign as release build and you can debug when it runs.
The solution from Illegal Argument is based on the value of the android:debuggable flag in the manifest. If that is how you wish to distinguish a "debug" build from a "release" build, then by definition, that's the best solution.
There's a window called 'Build Variants' where you can choose, which version you want to be installed on your emulator/device.
You also have to add debuggable true
to your release build to be able to debug it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With