Questions tagged [android-r8]

Questions related to R8, the default shrinker tool used in the Android build process

R8 is a tool designed to replace ProGuard as the default shrinker in the Android build process

303 questions
6
votes
2 answers

Android R8 Unable to find method

I have two problems. I am unable to build a release apk either way. When I disable R8 (preferring proguard), the build just goes on forever (sometimes crashing, citing 'out of memory: java heap space'), and when I enable R8, I get the following…
S Fitz
  • 1,074
  • 15
  • 31
6
votes
1 answer

Obfuscating app with R8 causes GC overhead limit exceeded

I just updated Android Studio to v3.4.1 Now I can't generate signed app while setting minifyEnabled true I know the default code shrinker is R8 now. And as the log says that's the problem. I can generate signed app without an issue if minifyEnabled…
S.R
  • 2,819
  • 2
  • 22
  • 49
6
votes
1 answer

How to keep class constructor argument parameter names with Android R8

I'm writing Android library, so I want to preserve parameter names for some constructors/methodes. I'm deploying my library as AAR file. After Gradle upgrade from 3.3.2 to 3.4.0 all arguments in constructors and public methods are renamed to…
coren
  • 63
  • 4
5
votes
1 answer

Error when minifying Android app with R8 after upgrading Android Gradle Plugin to 8.0.2

I recently upgraded the Android Gradle Plugin in my Android app project from version 7.4.2 to 8.0.2. However, I'm now encountering an error during the release build when the minifyReleaseWithR8 task is executed. The error message I'm getting is as…
JBokMan95
  • 81
  • 5
5
votes
1 answer

Issue on R8 minify

I installed the new version of Android Studio and did update of my project (without changing dependencies) and i had this issue: Missing class…
5
votes
1 answer

Data class metadata is removed with proguard / R8 for Kotlin 1.6.0

I have a package with some data classes and I'm trying to access the constructor at runtime using Kotlin reflection clazz.primaryConstructor, Everything is working as expected but when I enable R8, data classes metadata are removed so for example…
5
votes
1 answer

R8 Crashes Silently on Build

I get the following warning - error when building an Android release. WARNING:R8: Unexpected error during rewriting of Kotlin metadata for class 'androidx.lifecycle.LifecycleController$observer$1': com.android.tools.r8.internal.sG: lateinit property…
rtsketo
  • 1,168
  • 11
  • 18
5
votes
0 answers

How can I prevent part of a class's package name from being obfuscated with ProGuard (or R8)?

Let's say I have the following classes: com.example.whatever.ClassA com.example.whatever.ClassB I want to obfuscate my class and package names, but keep the com.example prefix. Obfuscating the above names with this in mind should output something…
ZakTaccardi
  • 12,212
  • 15
  • 59
  • 107
5
votes
3 answers

XML resource names are changed in release builds after upgrading Gradle plugin

After upgrading the Gradle plugin to 4.2.0 (before that, I didn't have this problem), it seems the names of XML resource files are changed when building a release build, for instance from res/xml/settings_master_switch_1.xml to res/cb1.xml. This…
Steve M
  • 9,296
  • 11
  • 49
  • 98
5
votes
1 answer

How to keep original line numbers in stack traces with R8?

I'm trying to figure out how to keep original line numbers with R8. Doing an app with current AndroidStudio and obfuscating it with R8, and even uploading mapping.txt file to Google Play Console, the Stack Traces of the users are useless in some…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
5
votes
1 answer

Google Play ask for deobfuscation txt file, Xamarin Forms

When I previously released my application it went well, but now I try to upload a new version of my application and Google Play says that it has some java/kotlin code in it and asks for me to upload an deobfuscation txt file. I have been looking for…
5
votes
3 answers

R8 changes "protected" methods of abstract class to "public" without -allowaccessmodification flag

I have an issue with R8. In MyLib I have public abstract MyLibsClass in which I have protected methods. MyChildClass extends from MyLibsClass in MyApp and after R8's magic all protected methods (including protected abstract) in MyLibsClass are…
Hayk Nahapetyan
  • 4,452
  • 8
  • 42
  • 61
5
votes
3 answers

Is "@Keep support annotation" rule in proguard-android-optimize.txt still applicable when using AndroidX?

It is common to apply proguard-android-optimize.txt as proguard file. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-project.txt' However, when I went through the content of…
Cheok Yan Cheng
  • 47,586
  • 132
  • 466
  • 875
5
votes
1 answer

DexArchiveBuilderException with Firebase Performance monitoring library, R8 failing to desugar?

I pretty much cannot build the project if I even just include the Firebase performance library, it fails with the following exception, I have no clue on how to resolve this, because it worked fine with an older Android Studio version(I am not sure…
5
votes
3 answers

Circular reference error in firebase with R8

We are getting following error with Firebase and R8. [CIRCULAR REFERENCE:java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Multiple entries with same key: Method com.google.firebase.iid.FirebaseInstanceId.zza Proto LLL…
Vivek Soneja
  • 850
  • 6
  • 7