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
11
votes
2 answers

Baseline Profiles x R8/Proguard

I've been experimenting with Android's Baseline Profile & MacroBenchmark libraries for improving the app performance. The question I have is that it is suggested that the MacroBenchmark's build-types be as close to the release build but with…
Darshan
  • 4,020
  • 2
  • 18
  • 49
11
votes
1 answer

Is r8 enabled on existing project after updating Android studio?

I updated Android studio and if I'm correct the update includes R8 by default to my projects. The question is is r8 only activated by default on new projects or did the update include that change also to my already created project? If not how can I…
Yava
  • 123
  • 1
  • 1
  • 7
11
votes
3 answers

How to use latest R8 Shrinker version

Because of a bug, I have used local jar file for R8 Shrinker (as recommended by R8 team) with adding the classpath to top gradle.build : classpath files($..../R8.jar/$) Now regardless of any update to the Android Studio the Gradle build still…
EAK TEAM
  • 5,726
  • 4
  • 30
  • 52
10
votes
2 answers

FirebaseCrashlytics: Error handling uncaught exception & java.util.concurrent.TimeoutException

I am getting this error message, which seems to be in relation with R8 minifying. It works with the debug build with minify enabled, which is weird. But I am getting it definitely in the release build type and when downloading the app from the Play…
Andre Thiele
  • 3,202
  • 3
  • 20
  • 43
10
votes
1 answer

What does R8 Full Mode really do? (aggressive optimizations)

The R8 official documentation says that to activate additional optimizations I must insert this in the gradle.properties file: android.enableR8.fullMode=true The documentation says that in order to make the App to work I must set some keep rules…
user2342558
  • 5,567
  • 5
  • 33
  • 54
10
votes
2 answers

Is there a way to prevent Android app code shrinker R8 from changing line numbers?

Android Studio started to use R8 instead of ProGuard by default recently. The stack traces from ProGuard are fairly easy to understand without using any tools despite code is obfuscated. Let's use the following example: …
Hong
  • 17,643
  • 21
  • 81
  • 142
9
votes
1 answer

R8 is causing Gradle Daemon to vanish on Github Hosted Action Runner

I am having issues with Githubs action runners while trying to compile the release version of my app. My app has 8 different flavors that we build and provide on the play store, and a few months ago I was able to build up to 3 of those flavors at…
9
votes
1 answer

How to deobfuscate R8 Stack traces?

I have an app and it crashes just like every good app should! A little while ago, the Android build tools started using R8 instead of Proguard. It worked and it sped up my build, so I left it alone. Then came an exception stack trace that I had to…
copolii
  • 14,208
  • 10
  • 51
  • 80
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
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
8
votes
2 answers

com.android.tools.r8.CompilationFailedException:Compilation failed to complete, position:Lcom/facebook/login/DefaultAudience$EnumUnboxingLocalUtility;

I have some error, after updated kotlin version (ext.kotlin_version) to 1.6.10: com.android.tools.r8.internal.E00: Unexpected type in conversion to primitive: OBJECT Execution failed for task ':app:minifyReleaseWithR8'. >…
Alex
  • 1,407
  • 2
  • 10
  • 19
8
votes
1 answer

java.lang.IncompatibleClassChangeError inside FirebaseInitProvider.onCreate when starting app with minifyEnabled true

Tested Environment / Dependencies Android Studio: Android Studio Arctic Fox Beta 2 and Bumblebee Canary 1 AGP: 7.1.0-alpha01 Firebase Analytics: com.google.firebase:firebase-analytics-ktx:19.0.0 Firebase Crashlytics:…
shoheikawano
  • 1,092
  • 3
  • 14
  • 31
8
votes
3 answers

Migrating Android project with proguard to R8, missing rt.java file, Android Studio 4.2

I update my Android Studio version from 4.1 to 4.2 and the project is not compiling because the Proguard version was very old (4.7) and it was not compatible with Java 10, however I decided to migrate my project from proguard to R8, but the project…
dicarlomagnus
  • 576
  • 4
  • 17
8
votes
1 answer

Obfuscation of Kotlin Data Class' toString Method

I use Kotlin data classes everywhere in my app. I am using R8 at compile time. I have a security requirement where the generated toString method cannot contain the original attribute name. At the moment, the generated method, contains the entire…
StuStirling
  • 15,601
  • 23
  • 93
  • 150
8
votes
3 answers

R8 minify: Type defined multiple times

When building a signed release APK I'm getting following error: .gradle/caches/transforms-2/files-2.1/532a317ccd54c8ae4f622faeb8b534a9/jetified-wordup-core-0.2.1-runtime.jar:de/codereddev/wordup/database/WordDao_Impl$5.class, Type…
CodeRed
  • 481
  • 4
  • 17
1
2
3
20 21