6

I enabled R8 plugging for obfuscation

I got an exception when I am trying to generate the signed apk

"Library class android.content.res.XmlResourceParser implements program class org.xmlpull.v1.XmlPullParser"

I have added below proGuard rule to the proguard-rules.pro file

-dontwarn org.xmlpull.v1.**
-dontnote org.xmlpull.v1.**
-keep class org.xmlpull.** { *; }
-keepclassmembers class org.xmlpull.** { *; }

and My release build specification

buildTypes {
        release {
            useProguard false
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }

Help to fix this issue

Kalai Selvi
  • 157
  • 11

3 Answers3

3

Add these lines in proguard-rules file:

-dontwarn org.xmlpull.v1.**
-dontwarn org.kxml2.io.**
-dontwarn android.content.res.**
-dontwarn org.slf4j.impl.StaticLoggerBinder

-keep class org.xmlpull.** { *; }
-keepclassmembers class org.xmlpull.** { *; }

Am 100% sure these lines will resolve your issue.

Ritika
  • 56
  • 3
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 23 '23 at 12:09
0

gradle.properties

android.enableR8.fullMode=false
Wonsik Sung
  • 61
  • 1
  • 2
0

Surprisingly, I have the same issue and adding these lines, mentioned by the question poster to my proguard-rules.pro solved it :

-dontwarn org.xmlpull.v1.**
-dontnote org.xmlpull.v1.**
-keep class org.xmlpull.** { *; }
-keepclassmembers class org.xmlpull.** { *; }