android studio 3.5 Warning: The rule `-keep public class * extends androidx.versionedparcelable.VersionedParcelable { <init>(); }` uses extends

我的梦境 提交于 2019-12-03 06:55:57

问题


Today, I updated my Android Studio to 3.5. After updated, I found below warning when I try to run the app.

The rule -keep public class * extends androidx.versionedparcelable.VersionedParcelable { (); } uses extends but actually matches implements.

I know warning is related with my proguard rules. So, I double checked my proguard rule file, but I am sure I didn't add that rule and it is not in my proguard rule file.

Below is the warning when I build the project.

My project is using AndroidX. Can anyone know that warning can be skipped or where that warning came from? Any ideas or alternative ways will be appreciating..


回答1:


It's a bug in the proguard.txt file in the versionedparcelable.aar version 1.0.0. This was fixed in version 1.1.0, however, if you're not using libraries that depends on the new version you'll get this warning in Android Studio 3.5.

In version 1.0.0 the proguard.txt file includes the following line:

-keep public class * extends androidx.versionedparcelable.VersionedParcelable

This was fixed in version 1.1.0:

-keep public class * implements androidx.versionedparcelable.VersionedParcelable

To bypass this issue you can force using the latest version by adding the following line to your build.gradle:

implementation "androidx.versionedparcelable:versionedparcelable:1.1.0"


来源:https://stackoverflow.com/questions/57601897/android-studio-3-5-warning-the-rule-keep-public-class-extends-androidx-vers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!