android - 未解析的类名 proguard-rules Android Studio 4.0

标签 android proguard 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
七月更新
Google 团队已经分析并增加了这个 bug,它可能与更新的 R8 版本有关。
8 月更新
已修复 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



-保持类不存在

有了这个评论,“not.existing”就没有错误了。`

enter image description here

关于android - 未解析的类名 proguard-rules Android Studio 4.0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62080165/

相关文章:

java - android项目中的project.properties

android - 支持库和 RecyclerView onBindViewHolder 和 onCreateViewHolder 的 Proguard 问题

java - Proguard while Butterknife 库和其他警告

android-studio - 与新版本不兼容的插件发现 : Firebase Services

android - 如何在 android 中将视频/音频文件转换为字节数组,反之亦然?

android - 如何在没有php的情况下在android中使用java使用volley检索mysql数据?

Android:将字符串的首字母转换为小写

android - Android Studio 中的 Proguard 不会删除日志记录

android - 在Android Studio 4.0上,Gradle同步失败

android - 在实时布局检查器中手动选择 Activity (Android Studio 4.0)