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
0
votes
0 answers

Getting an unclear runtime error message when using proguard

so whenever I uncomment the //proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' line in my app module's build.gradle file, my app crashes at runtime. If I keep this line commented, my app works…
Sbeve
  • 91
  • 2
  • 16
0
votes
0 answers

Execution failed for task ':app:minifyReleaseWithR8'. Cannot constrain type: @Null NULL for value: ... by constraint: INT

When I try to generate .apk file minifyR8 gives error like this Execution failed for task ':app:minifyReleaseWithR8'. Cannot constrain type: @Null NULL for value: v59(0) by constraint: INT It happens after I updated Android Studio, changed…
MaxB
  • 635
  • 1
  • 9
  • 22
0
votes
1 answer

How to convert the crash log into a readable form when using minifyEnabled and proguard?

My project has the following settings: buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' …
MaxB
  • 635
  • 1
  • 9
  • 22
0
votes
1 answer

r8 does not create output dex file

I'm trying to use r8 without much success: $ wget https://repo1.maven.org/maven2/com/mikepenz/fastadapter/3.2.7/fastadapter-3.2.7.aar $ wget https://maven.google.com/com/android/support/recyclerview-v7/26.0.1/recyclerview-v7-26.0.1.aar $ unzip…
OrenIshShalom
  • 5,974
  • 9
  • 37
  • 87
0
votes
1 answer

Android Getting R8 error: Already has a mapping when trying to run UI tests with minified build

I want to be able to run UI tests on a minified build. However when I run ./gradlew connectedDebugAndroidTest I get this error: > Task :app:minifyDebugAndroidTestWithR8 R8: 'void…
odiggity
  • 1,496
  • 16
  • 29
0
votes
1 answer

Missing class: androidx.paging.PositionalDataSource

When processing files with R8 it cannot find androidx.paging.PositionalDataSource: > Task :minifyReleaseWithR8 AGPBI: {"kind":"warning","text":"Missing class: androidx.paging.PositionalDataSource","sources":[{}],"tool":"R8"} How to mute this…
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
0
votes
0 answers

How do you use proguard just to replace class names and variables?

I had a horrible time with proguard and ultimately decided not to use it to remove code. Instead I intent to use it just to replace the variable and classes name just so that my code is not all available with a simple JDAX decompile. Anyone knows…
JoanaBrew
  • 11
  • 4
0
votes
1 answer

Enabling ProGuard and code minification and obfuscation

I have fully built app that is already used by people on Google Play. Currently on my to-do list is enabling pro-guard and enable code minification and obfuscation. I tried enabling it, but I it seems to me that minification does something that…
Vitaliy-T
  • 733
  • 6
  • 23
0
votes
2 answers

Is there a way to log filenames in release build using timber for android?

I just started using timber for logging on android, we are trying to add filenames/class-names to log message. I was able to add filenames in debug build using debug tree, but I'm not finding a way to add filenames in the release tree. Is there a…
stallianz
  • 176
  • 1
  • 17
0
votes
1 answer

NavController don't renamed after obfuscation

Why after obfuscation in androidx.navigation NavControllerViewModel renamed, but NavController don't renamed?
0
votes
1 answer

Duplicate DatabindingComponent class found while generating bundle

I get this error when i try to generate App Bundle for release. Component used: 'com.android.tools.build:gradle:4.1.0' 'com.google.gms:google-services:4.3.4' Version used: Android studio 4.1 :app:minifyReleaseWithR8…
0
votes
1 answer

rawQuery() always executes immediately, no matter how long the actual query takes

I have been pulling my hair out for hours trying to understand why a pretty straight-forward Android code breaks the fundamental synchronization in my app. The method below always executes immediately, despite the fact that it has an…
DmitryO.
  • 973
  • 5
  • 8
0
votes
0 answers

How to disable a specific Proguard/R8 rule for a third-party library

I am using minifyEnabled true in build.gradle (for obfuscation and size reduction purposes). I have these proguard-rules.pro: -keep class com.some3rdpartylibrary.** { *; } // otherwise it crashes # repack obfuscated classes into single package so…
c0dehunter
  • 6,412
  • 16
  • 77
  • 139
0
votes
1 answer

Release build with R8 not excluding classes

I'm facing some issues when compiling the release version of my app. I'm currently using Room and I have my model classes are under: com.example.room.entity and in order to let the app working I'm using a proguard rule -keepattributes…
0
votes
1 answer

Android Progaurd rules package names regex

I need to add my Json Model data classes to progaurd rules. But my model classes are located in several packages. Eg., assume model classes are present in the following…