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
5
votes
1 answer

When using R8 on Android, do I need to uninstall my existing Proguard?

Do I need to remove Proguard related code from Gradle when using R8? minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
dylan.kwon
  • 435
  • 5
  • 14
5
votes
1 answer

Android/Java obfuscation : R8 vs (ProGuard or DexGuard)?

I wonder what is the most powerful obfuscation tool (to avoid reverse engineering): between R8 and ProGuard between R8 and DexGuard Thanks.
toto_tata
  • 14,526
  • 27
  • 108
  • 198
4
votes
1 answer

React native app crashing after enabling R8 / minifyEnabled

My react native app is crashing after enabling R8 by making the following changes in app/build.gradle. The build is successful but the app crashes on the run-time. Here's the code:
sakshya73
  • 5,570
  • 5
  • 22
  • 41
4
votes
2 answers

How to keep class' members untouched if it contains a field with an annotation in proguard

How do I configure proguard/R8 to keep all the fields and methods of a class if the class contains an annotated field? I have a class public class MyDocument { @DocumentId private String foo; private String bar; public getFoo() { .. } …
Hilikus
  • 9,954
  • 14
  • 65
  • 118
4
votes
1 answer

Proguard (R8) obfuscate custom view names

I am using R8 in my app and have several custom views (which are referenced in xml layouts) tho their names are not obfuscated at all. Is there any way to achieve this? I am using the standard Gradle rules: release { minifyEnabled true …
Alex Newman
  • 1,369
  • 12
  • 34
4
votes
1 answer

Android R8 not obfuscating class names

I have been researching this for the past few hours without any luck. Class names are not obfuscated no matter what. These are just regular classes, not Activities, Services, or something else which is also in Android Manifest (I know those don't…
c0dehunter
  • 6,412
  • 16
  • 77
  • 139
4
votes
1 answer

R8: NullPointerException during IR Conversion

I have a problem when trying to generate a release version of my app. It gives a strange error C:\Users\rshal\.gradle\caches\transforms-2\files-2.1\6c326691eb00442622017dd95f96e92a\jetified-firebase-config-19.1.3-runtime.jar: R8:…
4
votes
2 answers

NullPointerException during IR Conversion with android-gradle-plugin 3.6.0

Release build throws (when using gradle installRelease) : NullPointerException during IR Conversion After upgrading com.android.tools.build:gradle from 3.5.3 to 3.6.0. Error happens when transforming jetified lib from…
avianey
  • 5,545
  • 3
  • 37
  • 60
4
votes
3 answers

Gradle task for Sentry not compiling

I have to add the Analytics tool Sentry to our Android project. In order to make it work, one needs to create mappings for the obfuscated code (from Proguard/R8) and upload it later to Sentry. On the website https://docs.sentry.io/platforms/android/…
Tobias Reich
  • 4,952
  • 3
  • 47
  • 90
4
votes
3 answers

R8 throws NullPointerException from within AndroidStudio, but not from commandline via gradlew

Problem When I click on the debug icon in Android Studio, I get this NullPointerException from R8. Executing tasks: [:app:assembleDebug] in project /Users/gary/Developer/Foo/Foo-Android > Task :app:preBuild UP-TO-DATE > Task :app:preDebugBuild…
4
votes
1 answer

How to add r8 rules in android?

How we can add R8 rules in an android project for dependencies and excluding files and packages from minifing and obfuscate?.
Eldhopj
  • 2,703
  • 3
  • 20
  • 39
4
votes
2 answers

R8 issue: Unable to set up Proguard minifyEnabled because of error GC overhead limit exceeded

Error while generating release bundle with minifyEnabled true option. Here are the Gradle settings which give me the error: buildTypes { release { minifyEnabled true shrinkResources true proguardFiles…
Yuliia Ashomok
  • 8,336
  • 2
  • 60
  • 69
4
votes
1 answer

How to write progaurd rules for android databinding click listener?

I am using databinding in my app and it is working perfectly. But when I enable minifyEnabled true and shrinkResources true than it show me some errors. Execution failed for task':app:transformClassesAndResourcesWithR8ForDebug'. Caused by:…
Jitendra Singh
  • 200
  • 4
  • 17
4
votes
2 answers

com.android.tools.r8.utils.AbortException zza already has a mappin

I'm running instrumentation tests and getting this compile error: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:transformClassesAndResourcesWithR8ForDebugAndroidTest'. at…
tir38
  • 9,810
  • 10
  • 64
  • 107
4
votes
2 answers

Error generating signed APK due to proguard rules

Generating signed APK giving error after I updated Android Studio to 3.3-rc01 and enabled R8 code shrinking. It is giving following proguard error : Error: ~/app/proguard-rules.pro, offset: 2613, line: 74, column: 7, Expected char '-' at…
Krishna Meena
  • 5,693
  • 5
  • 32
  • 44