Questions tagged [android-proguard]

The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer.

The ProGuard tool shrinks, optimizes, and obfuscates your code by removing unused code and renaming classes, fields, and methods with semantically obscure names. The result is a smaller sized .apk file that is more difficult to reverse engineer. Because ProGuard makes your application harder to reverse engineer, it is important that you use it when your application utilizes features that are sensitive to security like when you are Licensing Your Applications.

ProGuard is integrated into the Android build system, so you do not have to invoke it manually. ProGuard runs only when you build your application in release mode, so you do not have to deal with obfuscated code when you build your application in debug mode. Having ProGuard run is completely optional, but highly recommended.

Official Documentation

1030 questions
10
votes
2 answers

firebase ProGuard error (warning) with library version 11.2.0

I was working on 11.0.4 firebase libraries version. Today I've switched to the newest: 11.2.0 and when I try to build release version (with ProGuard on) I get the error: Warning:com.google.android.gms.internal.zzbdo: can't find referenced method…
AppiDevo
  • 3,195
  • 3
  • 33
  • 51
10
votes
2 answers

Android and AWS Cognito - Unable to unmarshall error response with proguard

I am using the AWS cognito SDK for Android, version 2.4.3. It works perfectly fine on debug version, but on release versions, in case of error, I cannot get a proper description on the exception. Instead, I get…
Nicolás Arias
  • 1,053
  • 1
  • 12
  • 29
10
votes
1 answer

How to disable generation of dump.txt by proguard when building android gradle project

I have an android project build with gradle. It is obfuscated with proguard. Proguard generates dump.txt file that has 70 MB. I don't want it. I don't need it. It exausts my SSD. Hou can I disable dump.txt file generation?
babay
  • 4,689
  • 1
  • 26
  • 40
10
votes
2 answers

How to configure Proguard to keep static methods with different return times

I have a set of classes (more than 50) that contain a few static methods called parse() that returns an instance of that class. This is an example of one of those classes: class SomeType { // Parse methods public static SomeType parse(String…
Mike Laren
  • 8,028
  • 17
  • 51
  • 70
10
votes
1 answer

Proguard and RecyclerView item decoration

I'm experiencing somewhat unexpected behavior with ItemDecoration for RecyclerView elements. On some phones (Samsung Android 5 devices), my ItemDecoration is not showing when proguard is applied with the build (minify true). Without proguard/minify…
Aviran
  • 5,160
  • 7
  • 44
  • 76
10
votes
5 answers

NoClassDefFoundError: android.support.design.internal.NavigationMenu on Android 4.2.2 (wiko)

I am trying to use the Android Support Design library (in version 23.0.1) and the class NavigationMenu (I use this class as an XML tag into a layout). When I execute my app on a Samsung on Android 4.3 or on a Nexus on Android 5.x or 6.0 everything…
10
votes
3 answers

Android Studio - Gradle incremental build

In the last few days I have been trying to improve the build time for our project with no luck. I don't mind having to wait 1m40s for a clean build, but if I insert one line in a single java file, I get the same build time as in a clean build. I…
Fabio Picchi
  • 1,202
  • 2
  • 10
  • 22
9
votes
1 answer

What does "-keepattributes SourceFile,LineNumberTable" mean for the new Android code shrinker R8?

The auto-generated proguard-rules.pro has the following: # Uncomment this to preserve the line number information for # debugging stack traces. #-keepattributes SourceFile,LineNumberTable I have had this commented out for years and it worked…
Hong
  • 17,643
  • 21
  • 81
  • 142
9
votes
1 answer

proguard-rules.pro does not seem to work with R8

I upgraded my Android Studio to 3.4 earlier today, and I am using the default shrinker R8 for the first time. I copied the contents of proguard-project.txt of a library project to its proguard-rules.pro. proguard-project.txt worked flawlessly for…
Hong
  • 17,643
  • 21
  • 81
  • 142
9
votes
3 answers

How to set proguard rule for Room library on Android

In my application i want use Room library for use database, and for finally for generate APK i enable minify option (proguard) in Build.Gradle . I use below version of Room library : implementation…
Dr. Jake
  • 249
  • 2
  • 3
  • 9
9
votes
2 answers

Failed to find byte code for Volley when using it in an Android library AAR

I'm using Volley in a library project that I've built into a AAR file. I add the AAR file into the main project. When building the main project, I get the following error: Failed to find byte code for com/android/volley/Response$Listener I'm…
zundi
  • 2,361
  • 1
  • 28
  • 45
9
votes
2 answers

AndroidX on Android Studio 3.2 - VerifyError when running app

Migrated my app to AndroidX libraries on Android Studio 3.2. When running in debug, everything works as expected but if I generate a signed APK, obfuscated using Proguard - I get this error: java.lang.VerifyError: Verifier rejected class d.a:…
Lior Iluz
  • 26,213
  • 16
  • 65
  • 114
9
votes
1 answer

Android Library: Release .aar getting classes.jar empty when using proguard

I'm trying to generate a library with minifyEnabled true but, inside the release .aar, classes.jar is getting empty. I have checked my proguard-rules.pro and it seems to be all right. I've even created a new module with the default .gradle files and…
Danilo
  • 171
  • 1
  • 8
9
votes
3 answers

Android : shrinkResources is failing to build

I m trying to use shrinkResources and its failing at the build time. I don't see any issue when I don't shrinkResources. I have following configurations: minifyEnabled true shrinkResources true gradle versions classpath…
9
votes
2 answers

Run Proguard on multi-module project as "one piece"

TLDR: How to pass proguard mapping to javac to compile against obfuscated library ? That's long, but I don't see how to make it shorter: Background: I have the following product setup: Android Studio project - Library module - (sub)module Core …
Kirill K
  • 771
  • 6
  • 17