未解决的类名称保护规则Android Studio 4.0 [英] Unresolved class name proguard-rules Android Studio 4.0

查看:1008
本文介绍了未解决的类名称保护规则Android Studio 4.0的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我更新到Android Studio 4.0 Proguard-rules时,它显示警告Unresolved class name.下面是示例,但我确定它仍会警告项目中的存在类.

-keep class com.squareup.haha.** { *; }
-keep class com.squareup.leakcanary.** { *; }

如果我从**更改为*,则此警告消失了.

-keep class com.squareup.haha.* { *; }
-keep class com.squareup.leakcanary.* { *; }

有人知道吗?我应该忽略此警告还是Android Studio 4.0的错误?

更新

我发现它是错误,已经分配但未解决 https://issuetracker.google.com/Issues/153616200

7月更新

Google团队已经分析并增加了此bug的优先级,它可能与R8的较新版本有关.

更新八月

已修复AS 4.2 Canary 9

解决方案

检查此问题: https://issuetracker.google.com/issues/147802433

`如果您右键单击错误,则会在AS添加注​​释(例如)之后显示选项为语句压制".

noinspection ShrinkerUnresolvedReference

-不存在课程

使用此注释,不存在"没有错误.

When I update to Android Studio 4.0 proguard-rules it shows warning Unresolved class name. Below is example but I sure it still waring the exist class in my project.

-keep class com.squareup.haha.** { *; }
-keep class com.squareup.leakcanary.** { *; }

If I change from ** to * this warning is gone.

-keep class com.squareup.haha.* { *; }
-keep class com.squareup.leakcanary.* { *; }

Does anyone get this? Should I ignore this warning or it's bug of Android Studio 4.0?

Update

I find it's bug, it already assigned but not resolved https://issuetracker.google.com/issues/153616200

Update July

Google team already analysis and increase priory of this bug, it may be related to a newer version of R8.

Update August

Fixed in AS 4.2 Canary 9

解决方案

Check this issue: https://issuetracker.google.com/issues/147802433

`If you right-click on error, there is option "suppress for statement", after that AS adds a comment such as:

noinspection ShrinkerUnresolvedReference

-keep class not.existing

And with this comment there is no error for "not.existing".`

这篇关于未解决的类名称保护规则Android Studio 4.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆