question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't build APK with ProGuard minify enabled.

See original GitHub issue

Hello, I can’t build APK with this enabled:

buildTypes {
        release {
            debuggable false
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
        //...
}

When I’m trying to build APK file, Android Studio throws this error in build output dialog: Execution failed for task ':app:transformClassesAndResourcesWithProguardForRelease'.

Is there any way to fix this issue? I want to keep APK size small.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

5reactions
PawelPleskaczynskicommented, Apr 1, 2018

Nevermind, I can now build APK. I added these lines as well:

-dontwarn okio.**
-dontwarn okhttp3.**

Thank you for your help 😃

0reactions
PawelPleskaczynskicommented, Apr 1, 2018

It’s still not working 😕 I guess I’ll disable ProGuard

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't build APK with Android Studio when using ProGuard ...
I have a problem generating the APKs of my applications. ... with all the dependencies. ... How do I fix it so the...
Read more >
Can't build release APK with minifyEnabled #28979 - GitHub
Try adding a dependency on the support-fragment library to the build type in the Gradle script that uses minifyEnabled . For example: buildTypes ......
Read more >
Shrink, obfuscate, and optimize your app - Android Developers
When you build your project using Android Gradle plugin 3.4.0 or higher, the plugin no longer uses ProGuard to perform compile-time code optimization....
Read more >
Secure your codes by enabling Proguard in Android App
2. Just make minifyEnabled true for enable proguard. You may also enable shrinkResources and useProguard true for reducing your apk size by removing...
Read more >
minifyEnabled=true for debug buildType don't work after AGP ...
Hi, I updated AGP to the latest version and found that minifyEnabled flag stopped working for debug buildType.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found