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
33
votes
4 answers

Gradle : DSL element 'useProguard' is obsolete and will be removed soon

Since the 3.5 update of Android Studio, I have this warning when building my app : DSL element 'useProguard' is obsolete and will be removed soon. Use 'android.enableR8' in gradle.properties to switch between R8 and Proguard..
Greelings
  • 4,964
  • 7
  • 34
  • 70
32
votes
1 answer

Android/java: Transition / Migration from ProGuard to R8?

I wonder how to make the transition / migration from ProGuard to R8. Should I just remove the Proguard-related lines from my Gradle files and add the android.enableR8 = true line instead ? Thanks.
toto_tata
  • 14,526
  • 27
  • 108
  • 198
31
votes
2 answers

GC overhead limit exceeded when enable R8 Shrinker in Android Studio

I'm using Android Studio 3.4 (Canary 9), when I build my app, it failed with the following error Task :app:transformClassesAndResourcesWithR8ForDebug R8 is an experimental feature. If you experience any issues, please file a bug at…
nhoxbypass
  • 9,695
  • 11
  • 48
  • 71
30
votes
8 answers

Fatal Exception: java.lang.NullPointerException in release build

I am facing a weird issue in the release build of the app. Here's my exception Fatal Exception: java.lang.NullPointerException` throw with null exception in.hopq.hopq.authentication.models.AppUpdateSourceDO$AppUpdate.getMinAllowedVersion…
pratham kesarkar
  • 3,770
  • 3
  • 19
  • 29
30
votes
3 answers

Difference between D8 and R8 android

As android studio introduced two new tools D8 and R8. As per google documentation D8 is a dex tool and R8 is a progourd tool but as their explanation both are doing almost same thing like below: D8 is a dexer that converts java byte code to dex…
0xAliHn
  • 18,390
  • 23
  • 91
  • 111
26
votes
3 answers

How to turn off only the obfuscation in Android R8?

I use Android Studio 3.3 Canary 5, Gradle 4.9, gradle plugin 3.3.0-alpha05 minifyEnabled true useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' Does't work. Edit: @JakeWharton: "You use ProGuard…
norbDEV
  • 4,795
  • 2
  • 37
  • 28
21
votes
2 answers

Getting OutofMemory issue when building with Android Studio 3.4 using code shrinker R8

I'm using the latest stable version of Android Studio - 3.4. When I build a debug apk(without proguard) it works fine. But the issue comes when getting a release build. It uses the latest R8 shrinker by default. It gives me an out of memory error. I…
chathura
  • 3,362
  • 6
  • 41
  • 68
20
votes
1 answer

Firebase Crashlytics Minify R8 Android

The app works fine under normal instances but when I try to implement minify and R8. This raises the following error. * What went wrong: Execution failed for task ':app:uploadCrashlyticsMappingFileAlpha'. > Failed to calculate the value of task…
lets start coding
  • 1,839
  • 1
  • 10
  • 19
20
votes
2 answers

What is the difference between Proguard and R8?

The new version of Android Studio (3.4) just came out and brings with it default support for R8 instead of Proguard. Could someone explain the key differences between the two and any apparent benefits to using R8?
Robert Metcalfe
  • 241
  • 1
  • 2
  • 5
13
votes
5 answers

Android Gradle Build Plugin 4.0.0 & R8 Desugaring not working on API 19

I'm switching an Android application from using Proguard's desugaring to the new R8 desugaring available in Android Gradle Build Plugin 4.0.0. I've followed the steps as detailed in the official documentation to enable Java 8 library…
13
votes
2 answers

Why is minifyEnabled is false in release builds by default?

In build.gradle (app) file we have this by default, buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } According to…
12
votes
3 answers

Proguard R8 warnings

Getting these warning while using r8 Missing class org.bouncycastle.jsse.BCSSLParameters (referenced from: void okhttp3.internal.platform.BouncyCastlePlatform.configureTlsExtensions(javax.net.ssl.SSLSocket, java.lang.String, java.util.List) and 1…
Uzzam Altaf
  • 303
  • 4
  • 8
12
votes
2 answers

How to get version of R8 that is being used by the Android Gradle Plugin?

How can I find out which version of R8 is being used by the Android Gradle Plugin for let's say 4.0.1? buildscript { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:4.0.1' } }
Niklas
  • 23,674
  • 33
  • 131
  • 170
12
votes
2 answers

Dealing with R8 + JvmStatic Annotation + Lambda in public API for Android Library written in Kotlin

First of all, please note that I'm not expecting why do you want to obfuscate library comments. This is a genuine problem I'm asking about. I have been having an issue dealing with R8/obfuscation with an Android library written in Kotlin. I've a…
shaktiman_droid
  • 2,368
  • 1
  • 17
  • 32
12
votes
2 answers

Android build fails with R8

Build is failing with the following error upon enabling R8 on android studio 3.4-RC3. Build is successful if android.enableR8=false Undefined value encountered during compilation. This is typically caused by invalid dex input that uses a register…
Nishita
  • 870
  • 1
  • 9
  • 33
1
2 3
20 21