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

How to secure data model classes from reverse engineering when using R8 and Proguard in Android?

Right now, on reverse engineering the android application APK file, I can see the data model classes in the plain text as I have used @keep annotation. Without the annotation, the app is crashing as these files are being removed by the R8. How do I…
Harshal Kshatriya
  • 5,630
  • 11
  • 44
  • 60
3
votes
1 answer

Firebase / Fabric Crashlytics and Proguard / R8

I have a project that I have migrated over to firebase Crashlytics from Fabric. This all worked fine initially and I received crash reports into firebase as expected. In the last couple of months it has come to light that firebase is no longer…
Zurvæ
  • 610
  • 1
  • 8
  • 23
3
votes
1 answer

com.android.tools.r8.utils.AbortException: Error: program input - Unsupported source file type

After I upgraded my android project to androidX I get the following build error: org.gradle.execution.MultipleBuildFailures: Build completed with 1 failures. at…
progNewbie
  • 4,362
  • 9
  • 48
  • 107
3
votes
2 answers

App crashed when R8 enabled with existing proguard settings

I got a RuntimeException on the release build when R8 enabled together with the existing proguard configuration. Checked "Failure to verify dex file Out-of-order annotation_element name_idx" with no luck, I haven't set -overloadaggressively…
rayworks
  • 741
  • 9
  • 15
3
votes
3 answers

How to make Amazon In-App Purchasing (IAP) 2.0 work with Android R8

It took a while after significant revenue loss to find out that Android R8 code shrinker prevents Amazon In-App Purchasing (IAP) 2.0 from working. Android Studio uses R8 by default now. Fortunately, the following in gradle.properties seems to be…
Hong
  • 17,643
  • 21
  • 81
  • 142
3
votes
2 answers

Enabling R8 causes "android.view.InflateException Error inflating class TextView" in TextView with fontFamily

I'm trying to shrink/obfuscate my release build with R8 (AS 3.3) but it's crashing trying to inflate an XML file, specifically on a TextView with a fontFamily. Removing the fontFamily attribute fixes the issue. XML file:
Jorge Gil
  • 2,805
  • 1
  • 15
  • 22
3
votes
1 answer

How to Solve Proguard Issue - ArrayIndexOutOfBoundsException?

I'm trying to Generate APK for my App. But After Building the compiler throws an java.lang.ArrayIndexOutOfBoundsException. I know what this Error means programatically. But If I disable the minifyEnabled to False. Then the APK is generated & the…
Arulnadhan
  • 923
  • 4
  • 17
  • 46
3
votes
0 answers

A component of R8 generating a VerifyError

I've been going through this issue for two days now. I've built my Release APK successfully, but when I tested this APK in a device, I got this exception: java.lang.VerifyError: Verifier rejected class m.a due to bad method void…
Gensoukyou1337
  • 1,507
  • 1
  • 13
  • 31
2
votes
1 answer

What is the potential issue with ProGuard and ClassValue on Android 14?

In the documentation for behaviour changes when targeting Android 14, there is an issue mentioned related to ProGuard and ClassValue: ProGuard issues: In some cases, the addition of the java.lang.ClassValue class causes an issue if you try to…
Adam Burley
  • 5,551
  • 4
  • 51
  • 72
2
votes
3 answers

Unable to invoke no-args constructor for class. Registering an InstanceCreator with Gson for this type may fix this problem

java.lang.RuntimeException: Unable to invoke no-args constructor for class com.arch.example.network.models.NetworkPagingList. Registering an InstanceCreator with Gson for this type may fix this problem. at…
user924
  • 8,146
  • 7
  • 57
  • 139
2
votes
1 answer

Android Gradle build stuck on app:lintVitalDebug

app:lintVitalDebug seems to be a subtask of app:minifyDebugWithR8. I recently upgraded to Android Studio Electric Eel, not sure if it is related. Only happens on release builds, so probably R8 is the culprit. I use Gradle dependency 7.3.1 and Gradle…
2
votes
0 answers

Is it possible to speed up R8

I'm looking at my production builds and 50% of the build time is in the task minifyProductionReleaseWithR8. Looking at Google's guides for optimizing build speed there is nothing mentioned about R8. Generally, I'm working towards breaking out more…
Zachary Sweigart
  • 1,051
  • 9
  • 23
2
votes
0 answers

Lambda Proguard R8, How keep lambda?

com.onesignal.-$$Lambda$OSInAppMessagePushPrompt$mIb8tlhn4VMS1tXne5sef5zwUzc -> f.g.a: com.onesignal.OneSignal$OSPromptActionCompletionCallback f$0 -> a 1:3:void…
2
votes
1 answer

android: Desugaring of ZonedDateTime results in TimeOffset being null

I'm trying to migrate from ThreeTen Android Backport to java.time with desugaring. On debug builds this works perfectly, but on release builds (minifyEnabled = true) I get a weird error on runtime. After a ZonedDateTime is serialized (passing a…
goemic
  • 1,092
  • 12
  • 24
2
votes
0 answers

I'm getting jetified-kotlin-reflect error while getting the release of the app in android kotlin

app:minifyReleaseWithR8 throws an error when it comes here. There is no error when minify is false. This error. Type kotlin.reflect.jvm.internal.impl.serialization.deserialization.builtins.BuiltInsResourceLoader is defined multiple times:…