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

Android R8 release build CIRCULAR REFERENCE with AGP 8.0.2

I can't build release apk file. Debug apk - created OK. It produces such an error, what I can add to proguard rules to fix this? Thanks. On Android Gradle Plugin 7.4.2 - release is building OK, but on next versions: 8.0.2 or 8.2.0-alfa06 - it…
yozhik
  • 4,644
  • 14
  • 65
  • 98
0
votes
1 answer

Missing class org.slf4j.impl.StaticLoggerBinder (referenced from: void org.slf4j.LoggerFactory.bind() and 3 other contexts) when using Pusher library

with R8 enabled (isMinifyEnabled = true) and using "com.pusher.pusher-java-client:2.4.4" library I get the following error for release build: AGPBI: {"kind":"error","text":"Missing classes detected while running R8. Please add the missing classes…
user924
  • 8,146
  • 7
  • 57
  • 139
0
votes
1 answer

Admob crash on initialization with "VerifyError" after upgrading to AGP 8

Updated to AGP 8 recently. I tested a release build on all my test devices prior to releasing to play store. Once released there, I am getting reports that a lot of users are crashing on app launch due in MobileAds.initialize() due to a…
idunnololz
  • 8,058
  • 5
  • 30
  • 46
0
votes
2 answers

Error in :app:minifyAlphaReleaseWithR8 For Android Studio Flamingo Java 17

After upgrading to Android Studio Flamingo using JDK 17 and AGP 8 I'm getting this error: ERROR: R8: Library class android.net.http.AndroidHttpClient implements program class org.apache.http.client.HttpClient Here's my build.gradle(app) android { …
0
votes
0 answers

java.lang.RuntimeException Error and App Crashing On Google Play Logcat Added

My app works on test device but crashes on playstore with this ERROR: Exception java.lang.RuntimeException: at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:4048) …
0
votes
1 answer

My project's structure is broken when using Proguard

I'm trying to add proguard rules. Even if I don't add these rules, some things break in my project the moment I set minifyEnabled to true. For example, the socket structure is broken, while trying to communicate with another device over socket, it…
ozgurbyk
  • 75
  • 7
0
votes
0 answers

How to retrace a stack trace, Android project written by kotlin code

My trace is like this , I can't retrace it by AndroidStudio tool : Code->Ananyze Stack Trace or Thread Dump how to retrace this stack? any tools ? how ? 214023: 02-27 10:18:11.369965 20576 20576 E BR-CrashHandler: java.lang.ClassCastException:…
0
votes
1 answer

Is there any way to disable Proguard configuration output?

I use this in each module of my multi-module library project proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), '../proguard-rules-library.pro' Is there any way I can disable configuration outputs to console on build stage?…
0
votes
1 answer

R8 minifyReleaseWithR8 FAILED: Attempt to enqueue an action in a non pushable enqueuer work list

Android Gradle Plugin version - 7.4.0 (the same with 7.3.1) | R8 version 4.0.48 (bundled with AGP) I try to generate signed release build with next configs in my build.gradle.kts file: getByName("release") { isDebuggable = false …
tasjapr
  • 632
  • 4
  • 13
0
votes
0 answers

Why r8 not shrink unused depencency

I am trying to shrink my app size. From https://developer.android.com/studio/build/shrink-code, r8 is meant to remove unused code. In my experiment, r8 can clean my code, but doesn't remove unused dependencies completely. This can be reproduced by…
bilabila
  • 973
  • 1
  • 12
  • 18
0
votes
0 answers

Implementing smack in android , after obfuscation getting error at runtime from smack library

Obfuscation tags used for Smack lib: -dontwarn org.xmlpull.v1.** -keep class org.jivesoftware.** { *; } -keep class org.xmlpull.** { *; } -keep class org.bouncycastle.jcajce.provider.** { *; } -keep class org.jivesoftware.smack.** { *; } -keep…
0
votes
1 answer

Missing class android.window.OnBackInvokedCallback

I am new with dotnet MAUI, still learning while working. I am trying to build my Android Application, I use my physical Device (Android 6.0 API 23). If I Debug or make Release the app is compiling and building without any errors and crashes and…
YouBT
  • 3
  • 1
0
votes
1 answer

How to remove all log calls except in specific package with prodguard and R8?

I've configured my Android project to remove all logging in "release" mode like so: build.gradle (app) postprocessing { removeUnusedCode false obfuscate false optimizeCode true proguardFile 'proguard-rules.pro' } pro…
Two Horses
  • 1,401
  • 3
  • 14
  • 35
0
votes
2 answers

Proguard / R8 removing a class member that it shouldn't

I'm not as experienced in the Proguard / R8 matters as others. But, I think that I've stumbled across a bug in the Proguard / R8 tool as used in Android Studio. I have some Java code that runs great in a standalone app. When I try to use it in my…
0
votes
1 answer

How to include jmods with R8 in Android?

With older JDK versions I included rt.jar in R8 configuration with -libraryjars /lib/rt.jar In order to meet requirements of various java libraries not Android-specific (NOTE this doesn't mean that whole rt.jar will be included in App,…
AndreaF
  • 11,975
  • 27
  • 102
  • 168