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
1
vote
0 answers

Execution failed for task ':app:minifyFullReleaseWithR8'

I am trying to build a release assembly with R8. There are many modules in the application. The navigation component is used to navigate between fragments. There are some fragments that are in one module, but are used in several. Because of this, 2…
1
vote
1 answer

Android Enum: generate AAR binary with R8 on and throws "Function invocation 'name()'" exception in client app

This is a pretty rare case and I have tried googled around but unfortunately nothing came out. Basically I wanted to create a library module and build an aar binary from it to share by different client apps. But one strange thing happens when I…
Panda World
  • 1,704
  • 1
  • 20
  • 28
1
vote
2 answers

How to exclude package name and sub package name while using progaurd In Android Studio?

I have my project package name as in.myapplication.app and I have a package which contains several packages as well like this in.myapplication.app.samplePackage in.myapplication.app.samplePackage.SubPackage Now I want to exclude all the classes…
AgentP
  • 6,261
  • 2
  • 31
  • 52
1
vote
1 answer

Proguard and R8 don't optimize my library code

When I connect my own library to project, it doesn't optimize. So: In my lib, i turn on minifyEnabled: apply plugin: 'com.android.library' ... debug { minifyEnabled true proguardFiles…
crysis74
  • 11
  • 2
1
vote
1 answer

Android class canonical name uniqueness after Obfuscation

Are class canonical names unique within a package after obfuscation? I currently use Koin Dependency Injection and create scopes based off of the Activity's and Fragment's canonical names automatically for some shared DI logic. Previously, I was…
PenguinDan
  • 904
  • 7
  • 15
1
vote
0 answers

Firebase does not work when proguard/R8 is enabled

I using ...:firebase-messaging:20.0.1 on android and everthing fine when proguard is disabled. but when proguard enabled app crash with this exception java.lang.RuntimeException: Unable to bind to service…
1
vote
1 answer

Sentry: Proguard mappings not uploaded when assembling with Gradle

I am using Sentry 2.0.0 in my Android app. The Sentry SDK works, but when obfuscating my app, the Sentry plugin is not uploading the Proguard mappings to their server (I can see crashes in the Sentry webapp, but the stacktrace shows obfuscated class…
GaRRaPeTa
  • 5,459
  • 4
  • 37
  • 61
1
vote
1 answer

Troubleshooting Android R8 Build

I need help figuring out the issue when building my app with R8. I have a service that performs a job and then terminates. However when I use R8 instead of Proguard, the service never terminates. The only way to make the R8 build work is to leave…
user1159819
  • 1,549
  • 4
  • 16
  • 29
1
vote
3 answers

Firebase + Proguard/R8

I am currently working on setting up Firebase (FCM) in my project and have encountered a problem when I run my R8-obfuscated app, the Firebase service (FirebaseMessagingService) no longer works. Has anyone encountered the same problem? Any…
1
vote
1 answer

Can I disable R8 just for some flavors without using command line?

I'm trying to release my app on amazon and apparently I can't use R8 if I want to use IAP. Currently I'm handling pretty much everything just using Gradle flavors. So how can I tell it to not use R8 for my Amazon flavor on Gradle? Thanks.
casolorz
  • 8,486
  • 19
  • 93
  • 200
1
vote
1 answer

Mobile App crashes after enabling R8 in release build

I am new to android development. I developed an android application which was working perfectly fine before enabling R8. After obfuscating the application, I am getting the following error. I have no idea where am I going wrong. Following is the…
1
vote
1 answer

Is there a way to obfuscate a class name but not the members with R8

I have a bunch of Retrofit Request/Response classes that get (de)serialized with GSON. I currently use @Keep to make sure that R8 doesn't make them abstract, or obfuscate the property names (which are needed for GSON). Is there any way I can…
Eliezer
  • 7,209
  • 12
  • 56
  • 103
1
vote
1 answer

Why does R8 not rename all methods and classes?

I'm trying for my first time an Android Studio version with R8 that perform obfuscation and code optimization. As the official documentation says: Obfuscate your code The purpose of obfuscation is to reduce your app size by shortening the names of…
user2342558
  • 5,567
  • 5
  • 33
  • 54
1
vote
0 answers

Caused by android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f0802ec

After changing my android build Gradle version from 3.2.1 to 3.5.0, gradle version from 5.1.1 to 5.4 and updating support libraries to androidx. we have this new issue occurring i.e, Resource not found in high numbers. Android-studio version is…
shalini
  • 355
  • 4
  • 17
1
vote
3 answers

Build with R8 failing -> Error: Multiple annotations of type `dalvik.annotation.EnclosingClass`

I am getting the error on building the project from command line: Caused by: com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: at…