android studio 3.5警告:规则-keep public class *扩展了androidx.versionedparcelable.VersionedParcelable {< init>(); }`使用extends [英] android studio 3.5 Warning: The rule `-keep public class * extends androidx.versionedparcelable.VersionedParcelable { <init>(); }` uses extends
问题描述
今天,我将Android Studio更新为3.5.更新后,我在尝试运行该应用程序时发现以下警告.
Today, I updated my Android Studio to 3.5. After updated, I found below warning when I try to run the app.
-保留公共类*的规则扩展 androidx.versionedparcelable.VersionedParcelable {(); }用途 扩展但实际上与工具匹配.
The rule -keep public class * extends androidx.versionedparcelable.VersionedParcelable { (); } uses extends but actually matches implements.
我知道警告与我的保镖规则有关.因此,我仔细检查了我的proguard规则文件,但是我确定没有添加该规则,并且不在我的proguard规则文件中.
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.
我的项目正在使用AndroidX.任何人都可以知道可以跳过警告或警告来自何处吗?任何想法或替代方式将不胜感激.
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..
推荐答案
这是 versionedparcelable.aar 版本1.0.0.该问题已在1.1.0版中修复,但是,如果您不使用依赖于新版本的库,则会在Android Studio 3.5中收到此警告.
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.
在1.0.0版中,proguard.txt文件包含以下行:
In version 1.0.0 the proguard.txt file includes the following line:
-keep public class * extends androidx.versionedparcelable.VersionedParcelable
此问题已在1.1.0版中修复:
This was fixed in version 1.1.0:
-keep public class * implements androidx.versionedparcelable.VersionedParcelable
要绕过此问题,您可以通过在build.gradle中添加以下行来强制使用最新版本:
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"
这篇关于android studio 3.5警告:规则-keep public class *扩展了androidx.versionedparcelable.VersionedParcelable {< init>(); }`使用extends的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!