IllegalStateException after obfuscation
See original GitHub issueReceiving ISE on creation of RealmConfiguration on release build which got obfuscated with Dexguard. Error message:
Caused by: java.lang.IllegalStateException: Couldn't find companion object of class 'ProductEntity'.
2022-04-06 10:55:01.901 32219-32219/? E/AndroidRuntime: A common cause for this is when the `io.realm.kotlin` is not applied to the Gradle module that contains the 'ProductEntity' class.
Added these rules for RealmObject classes which didn’t help:
-keep,includedescriptorclasses class com.projectname.data.vo.**$$serializer { *; }
-keepclassmembers class com.projectname.data.vo.** { *** Companion; }
-keepclasseswithmembers class com.projectname.data.vo.** {
kotlinx.serialization.KSerializer serializer(...);
}
Is there any additional configuration needed for it? Or is it rather general misconfiguration of Dexguard on my side? Any kind of these issues are not happening on pre-KMM version of project.
Issue Analytics
- State:
- Created a year ago
- Comments:8
Top Results From Across the Web
How to find offending class from obfuscated error message
I have a crash in my android app, which results in the following stack trace. The app is proguarded and I have the...
Read more >Koin MP occurs IllegalStateException in Android with R8
But when I run Android app with R8 obfuscation, the following exception occurs in Kotlin Native environment. ... Steps to reproduce the behavior:....
Read more >Obfuscate code error - Android
I tried to obfuscate the application by using minify true in build.gradle unfortunately, I got this when ... IllegalStateException: java.lang.
Read more >IllegalStateException: buildOutput.apkData must not be null ...
Hi guys! ... This is only happens for the build that builds apk with obfuscation. The non obfuscated builds are looking fine. Issue...
Read more >ProGuard Manual: Troubleshooting
Unexpected observations after processing¶ ... If ProGuard is not keeping the right classes or class members, make sure you are using fully qualified...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the end issue was not with Proguard/Dexguard. It got fixed after updating gradle plugin from 7.0.4 to 7.1.2. Cannot understand why it didn’t affect the debug build though.
@tarasmorskyi-mediamonks hmm https://github.com/realm/realm-kotlin-samples/tree/main/Bookshelf checks all the boxes (uses ProGaurd, model in multiplatform module and same Proguard rules …) I wonder if you can manage to reproduce the issue using the Bookshelf as a starting base (i.e copy your model from the production app into it for instance) ?