Questions tagged [proguard]

ProGuard is a tool to shrink, optimize, obfuscate, and preverify Java classes. It is included in the Android SDK.

proguard
Filter by
Sorted by
Tagged with
1 vote
0 answers
688 views

Error minifying Android app with R8 after upgrading Android Gradle Plugin to 8.1.0

After updating the Android Gradle Plugin in my Android app project to 8.1.0 I'm encountering an error during the release build when the minifyReleaseWithR8 task is executed. The error message I'm ...
Yury Matatov's user avatar
0 votes
0 answers
21 views

Android ProGuard keepattributes how to filter some specified attributes?

I want to package AAB not include debugging and stack traces informations. In our project‘s third party SDKs there include this rule: “-keepattributes SourceFile,LineNumberTable” and how can i write ...
user2706130's user avatar
0 votes
1 answer
55 views

IronSource proguard obfuscation rules

There is an app with IronSource integration. APK release version build, install and use is absolutely fine. But when I build AAB file, upload it to Google Play console and install it on device, it ...
ilya_kas's user avatar
  • 179
0 votes
2 answers
1k views

How to keep some com.google.android.play.core.* classes reported missing by R8 during a release build of a Flutter app?

When I build an APK it comes out to be 30MB. I recently upgraded to AGP 8.1 from 7.4, not sure if that screwed up something. The Task :app:minifyReleaseWithR8 FAILED fails. The short message is: ...
Csaba Toth's user avatar
  • 10.3k
2 votes
1 answer
573 views

Moshi LinkedHashTreeMap class cast exception with Proguard

When proguard is enabled, after an API call with retrofit, I recieve a list of LinkedHashMapTree that causes this error: java.lang.ClassCastException: com.squareup.moshi.LinkedHashTreeMap cannot be ...
TabascoLosco's user avatar
0 votes
0 answers
41 views

Proguard obfuscation creates fafal exception LinkedHashMap cannot be cast

I use Retrofit to catch a json string that fills a POJO The POJO class is: public class Entries{ public ArrayList<Entry> entries; public Entry entry(int index){ return entries....
Vincent's user avatar
  • 1,702
4 votes
1 answer
769 views

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....
Adam Burley's user avatar
  • 5,753
1 vote
0 answers
50 views

Is proguard-android.txt obsolete?

Up until not too long ago, I followed the guideline that "In general, it is a good idea to use the proguard-android.txt file as the default proguard file and then add any additional rules that ...
Introspective's user avatar
0 votes
1 answer
109 views

I don't want to obfuscate my files from asset directory, what can be done for this?

App is getting crashed in release mode while reading files from asset directory. In debug mode its working fine. proguard is creating problem. How can I protect those files from obfuscation? I tried ...
Omkar Ingawale's user avatar
0 votes
0 answers
801 views

How to use Proguard in Kotlin Multiplatform (KMM) shared module

This is my :shared->build.gradle.kts file plugins { kotlin("multiplatform") id("com.android.library") id("maven-publish") } group = "com.example"...
Azim Ansari's user avatar
0 votes
0 answers
76 views

Cannot keep class name for Kotlin functions inside AAR

I have an AAR library to use in several Android applications. It was written most in Java but I want to rewrite some utils pseudoclasses in Kotlin to make further development easier. But when I did so ...
artaxerx's user avatar
  • 283
1 vote
0 answers
291 views

Constructor parameter renamed to arg0 with Proguard/R8

I am using reflection to read the name of the constructor's parameters. When I enable proguard (isMinifyEnabled = true) the parameter name becomes arg0, making my reflection fail. I have tried many ...
lotdrops's user avatar
  • 300
1 vote
0 answers
60 views

Keep companion property from the child class but not from the parent

My situation is the following I have class with a public companion object as it follows: open class ParentClass { ... companion object { ... const val CONST_PROPERTY = "value" ...
Ronie M's user avatar
  • 71
0 votes
0 answers
180 views

Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ArrayIndexOutOfBoundsException

my android application works fine on real devices. but when I install it on emulators like genymotion it installs fine. but when I run/tab it, it stops working and in the logcat this log is written ...
hanan's user avatar
  • 572
0 votes
1 answer
307 views

Conflict between library and program classes during R8 optimization in Android - multi module project

I am encountering an issue related to R8 ofuscation in my app application. During the build process, I receive the following error message: AGPBI: {"kind":"warning","text"...
Antony Nicolas Huaman Alikhan's user avatar
1 vote
1 answer
56 views

Proguard XmlRpc and Javac Parser

I'm getting an error in the release version of my app. java.lang.NoSuchMethodError: No virtual method getXMLReader()Le9/k; in class Ljavax/xml/parsers/SAXParser; or its super classes (declaration of '...
Akbar Sukku's user avatar
0 votes
0 answers
35 views

How to instruct ProGuard to completely remove a particular class from the build?

On an Android App (Hybrid Capacitor/Android App) I have a flag on my BuildConfig called LIVE_RELOAD. When it is set to true, I load a plugin that disables SSL Checking so I can use a self-signed ...
distante's user avatar
  • 6,740
1 vote
1 answer
715 views

AAPT2 aapt2-4.1.0-6503028-osx Daemon #0: Unexpected error during link, attempting to stop daemon

What went wrong: Execution failed for task ':app:processDebugResources'. A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade AAPT2 aapt2-4.1.0-6503028-osx ...
Lalit Patel's user avatar
5 votes
1 answer
998 views

Android obfuscation issue with Retrofit migrating to Android Gradle Plugin (AGP) 8 and Java 17

The problem I encounter an obfuscation issue migrating from Android Gradle Plugin (AGP) 7.4.2 to 8.2 and Java 11 to 17: Unable to create @Body converter for class package.api.data.device.DevicesBody (...
romainb78's user avatar
0 votes
1 answer
142 views

Android app logs not logging in release build

I am using android.util.Log for logging in to my Android application. I am storing these logs to a text file for analyzing the production issues. but recently these my application-level logs are ...
Prakash's user avatar
  • 159
0 votes
1 answer
162 views

Getting method not resolved error when using Sendbird SDK with minifyEnabled true when building Android app

I am using Sendbird SDK to implement chat functionality in Android app. In debug mode everything works fine, however once I create a release build with minifyEnabled = true to obfuscate the code using ...
Bruce's user avatar
  • 2,477
1 vote
1 answer
91 views

Exception in build with proguard

I have a fat jar whcih include my package as well as all the dependencies. To obfuscate the jar ,I have addded proguard this is my gradle taks def dependsDir = "${buildDir}/libs/dependencies/&...
Vikas Kumar's user avatar
0 votes
0 answers
31 views

Unable to create instance of class database.networkData.TufeeResponse(Network Response Handler DTO)

What I have changed This app was working fine until I have upgrade agp to 8.0.2 and gradle version to 8.0. || Android Studio Hedgehog 2023.1.1 Canary 8 Full Error Unable to create instance of class ...
Gulab Sagevadiya's user avatar
0 votes
1 answer
258 views

Android IllegalArgumentException: Unable to create call adapter for retrofit2.Call<wh3>

I have encountered the following runtime exception with my android application having upgraded from AGP 7.4.2 to 8.2.0-alpha07 java.lang.IllegalArgumentException: Unable to create call adapter for ...
Hector's user avatar
  • 4,516
6 votes
1 answer
2k views

Error when minifying Android app with R8 after upgrading Android Gradle Plugin to 8.0.2

I recently upgraded the Android Gradle Plugin in my Android app project from version 7.4.2 to 8.0.2. However, I'm now encountering an error during the release build when the minifyReleaseWithR8 task ...
JBokMan95's user avatar
  • 119
0 votes
1 answer
599 views

kotlin proguard rules for kotlin reflection

Hello everyone I have an issue with kotlin reflection in release mode. I set proguard rules for keeping the data classes, enums, and reflection package but in a release mode , functions that are using ...
MohammadReza Berenji's user avatar
1 vote
1 answer
1k views

How to solve- Duplicate class found in two different external libraries

In my project there are two different external libraries // TheoPlayer Android SDK implementation ':theoplayerApi21@aar' // Pushly notification SDK implementation 'com.pushly.android:pushsdk:1.1.9' ...
Makarand's user avatar
  • 1,043
0 votes
0 answers
160 views

Android Proguard obscation issue for Azure Blob Storage Library

I am implementing the Azure Storage blob library for uploading files to the server. It is working well for debug build but giving issues for the signed build. If I make minifyEnabled false in the main ...
SaurabhG's user avatar
  • 173
3 votes
1 answer
937 views

Unable to correctly use proguard/r8 rules on Flutter 3.7.11

I cannot effectively exclude classes from code obfuscation in the final apk using flutter for android. I am developing a plugin that wraps some native android code / libraries and provides some ...
gabriele finello's user avatar
0 votes
0 answers
78 views

Using Proguard with Kotlin server

I can't configure Proguard for pure Kotlin app (no Android). Used code from their site: tasks.register<ProGuardTask>("proguard") { configuration("proguard-rules.pro") ...
Psijic's user avatar
  • 942
4 votes
0 answers
3k views

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 ...
yozhik's user avatar
  • 4,914
0 votes
0 answers
31 views

using proguard-retrace 7.0.0 not able to deobfuscate the line numbers

i am using proguard-retrace 7.0.0 version in my java project but i am not able to obfuscate the line numbers class and method name are working fine, Also is there any way to deobfuscate the lambda ...
NEHA NIGAM's user avatar
0 votes
0 answers
42 views

Issue with @Cacheable annotation not working after enabling ProGuard obfuscation

I'm encountering an issue with the @Cacheable annotation not working properly after enabling ProGuard obfuscation in my Spring application. The caching mechanism functions correctly when ProGuard ...
Shahzeb Iqbal's user avatar
2 votes
1 answer
226 views

Prevent ProGuard from changing Kotlin suspend functions signature

I'm trying to create a facade for the Android library. Basically, the facade is a Kotlin interface with a list of suspended methods: interface Facade { suspend fun doSomeWork(): String } As it is ...
Roman Svyatnenko's user avatar
4 votes
1 answer
459 views

Room database is working fine in Debug build but not working in Release build

Hi StackOverflow community, recently I have updated my Android project to Gradle 7.5 and Kotlin to 1.7.20. But since then I couldn't get the Room DB working in the release build. On Debug build it ...
Wiki's user avatar
  • 41
0 votes
0 answers
79 views

When using Proguard version 7.3.2 getting JSONException error

I am using openjdk11 and below is my proguard configuration <proguard ignorewarnings="true" repackageclasses="controller.deps" allowaccessmodification="true" ...
user4888455's user avatar
0 votes
1 answer
51 views

Why wont my Android app start after swipe from recent apps and relaunched after install from Google Play Store?

This is happening on a Samsung Galaxy s10 phone. The app crashes only when downloaded from the play store, opened, swiped from recent apps list, and re-opened. Crashes on re-open. The icon on the ...
CodeRunner's user avatar
3 votes
1 answer
3k views

Android App crashed with java.lang.NoClassDefFoundError: Failed resolution of: [Ljava/nio/file/LinkOption;

I'm getting the following exception after running my app with minifyEnabled true. But if I comment it out, the app opens just fine. Error AndroidRuntime E FATAL EXCEPTION: main Process: ...
Dhagz's user avatar
  • 721
5 votes
4 answers
124 views

Crash on HttpResponse when proguard is enabled

java.lang.IncompatibleClassChangeError: Class 'org.apache.http.message.BufferedHeader' does not implement interface 'org.apache.http.NameValuePair' in call to 'java.lang.String org.apache.http....
avez raj's user avatar
  • 2,115
1 vote
1 answer
176 views

Proguard 7.3.2 not able to find classes when using openjdk-11

I am using openjdk-11 and proguard version is 7.3.2 and while build one of the module i am getting many warnings as below: [javac] Reading library jmod [/opt/jdk-11/jmods/java.base.jmod] (filtered) 17:...
user4888455's user avatar
0 votes
0 answers
283 views

java.lang.NoSuchMethodError: No static method loadKoinModules after set minifyEnabled true

My app app has 3 module :app :core (android library) :favorite (dynamic feature, contain an fragment). I use Koin for dependecy injection. Everything is working fine, but after i set the minifyEnabled ...
Juan's user avatar
  • 1
13 votes
1 answer
5k views

Google Gson preserve generic signatures

Crashes in Firebase Crashlytics appear with a note how to fix a problem: Fatal Exception: java.lang.IllegalStateException: TypeToken must be created with a type argument: new TypeToken<...>() {};...
S. Gissel's user avatar
  • 2,302
0 votes
1 answer
378 views

Trouble with Observable of array of strings and Proguard

I have a simple Retrofit2 service public interface PlaylistService { @GET("/machines/{uid}/playlist") Observable<List<String>> getPlaylist(@Path("uid") String ...
Rodrigo's user avatar
  • 516
0 votes
0 answers
34 views

Issues with Proguard and obfuscation of Javascript code

In my android app I have a part that is a webview that send the application some javascript code. And the obfuscation when I build for release is not listening to me :( My proguard is looking like ...
lagos's user avatar
  • 1,968
0 votes
0 answers
36 views

Android app not retrieving data from firebase after release on play store

App behaviour in play store -Not retrieving data from firebase -When i change variable in textbox, i expect new elements to be displayed.It works correctly in debug mode but crashes after play store ...
blackcoder's user avatar
2 votes
1 answer
635 views

Define nested list type using gson while deserializing

By using new AGP v8.0 and full R8 enabled, when I'm trying to deserialize a nested object from a JSON string, the type of nested object is incorrectly identified as LinkedTreeMap by gson. actions_list....
HiddenCoder7's user avatar
2 votes
2 answers
935 views

While generating as signed APK I got this Error :app:minifyReleaseWithR8 FAILED

AGPBI: {"kind":"error","text":"Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in D:\...
Pinkdia Banth's user avatar
4 votes
1 answer
4k views

proguard-rules "-dontwarn" not working (AGP 8.0)

After updating to Android Gradle Plugin 8.0, I get the following build-time errors during the minifyReleaseAndroidTestWithR8 step: Missing classes detected while running R8. Please add the missing ...
Clo Knibbe's user avatar
0 votes
0 answers
37 views

How to debug proguard rules?

I am trying to debug my ProGuard rules after upgrading to Android Studio v2022.2.1 as the release build of my app has stopped working. I have checked the rules and found that adding -dontshrink to the ...
TRX's user avatar
  • 649
1 vote
2 answers
1k views

Proguard rules for Sealed classes

I have a sealed class as below. sealed class Fruits(private val category: String) { object Apple : Fruits("APPLE") class Banana : Fruits("BANANA) } It gets ...
Navinpd's user avatar
  • 812