How to Get Release Build APK File Using Proguard

How to get release build apk file using proguard

add this:

-dontwarn com.squareup.okhttp.**

to your proguard-rules.pro

How to get ProGuard mapping file of previous release build

The mapping file is overwritten after every build so you probably lost it for good.

The best approach I can think of would be versioning your code with some VCS (Git, for example) and moving the mapping file to a location that is not being gitignored.

To move the generated proguard mapping file to a different path check this answer. You can even rename it if you like.

Cannot build release apk with proguard

The problem was in the path to proguard-rules

Changed this piece of code

proguardFiles getDefaultProguardFile('proguard-android.txt'), '$project.rootDir/tools/proguard-rules.pro'

To this

proguardFiles getDefaultProguardFile('proguard-android.txt'), '../tools/proguard-rules.pro'

Unable to generate release Build apk

read this topic

And this one

While reading the info message, it gives me an idea about this Conscrypt and did a research and found out that I need to install conscrypt to my gradle.app

implementation 'org.conscrypt:conscrypt-android:2.2.1'

and it works.

Android apk release build fails with proguard

It was just the ProGuard minifyEnabled flag set to true causing an issue. Setting the flag to false allows for the build to be signed and released to the playstore. I'm sure I'll re-enable it once I know how to debug issues with it.

build.gradle

buildTypes {
debug {
debuggable true
jniDebuggable false
renderscriptDebuggable true
zipAlignEnabled true
}
release {
debuggable false
jniDebuggable false
renderscriptDebuggable false
renderscriptOptimLevel 3
minifyEnabled false
pseudoLocalesEnabled false
zipAlignEnabled true
}
}

Identifying errors in Release build of Android application

Proguard comes with certain problems but it works great for minifying the apk size. I will suggest that if you are using third party libraries in your app then use their proguard-rules as well in proguard-rules file.

To get error from signed apk use Fabric Crashlytic. Its easy to integrate(10 minute max) and it will show the complete stacktrace of exception on your fabric console .

Library resources get removed from folder and renamed on release

This was a rookie mistake. It had nothing to do with proguard or gradle. The issue came in when I had refactored the package name through File => Project Structure. It refactored everything except the release AndroidManifest so the app was trying to pull the resources from the wrong place on a release.



Related Topics



Leave a reply



Submit