Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
324 views
in Technique[技术] by (71.8m points)

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

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.

My Progurad File

Below is the warning when I build the project.

enter image description here

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..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...