Migrated my app to AndroidX libraries on Android Studio 3.2. When running in debug, everything works as expected but if I generate a signed APK, obfuscated using Proguard - I get this error:
java.lang.VerifyError: Verifier rejected class d.a: androidx.preference.Preference d.a.a(androidx.fragment.app.k, int)
failed to verify: androidx.preference.Preference d.a.a(androidx.fragment.app.k, int): [0x8] ‘this’ argument ‘Reference:
androidx.fragment.app.k’ not instance of ‘Reference:
androidx.preference.B’ (declaration of ‘d.a’ appears in base.apk)
I've tried excluding all AndroidX libraries:
-dontwarn androidx.**
-keep class androidx.** { *; }
-keep interface androidx.** { *; }
But the issue continues unless I basically cancel the obfuscation using
-keep class com.myapp.package.** { *; }
Also tried looking at the mapping file for what class d.a
is but it didn't hint me to the direction of the issue.
Jetifier is enabled
android.useAndroidX=true
android.enableJetifier=true
Am I missing something here? Any chance this is an issue with the androix.preference library?
- Opened a bug on Google issue tracker.