Unresolved class name proguard-rules Android Studio 4.0

倾然丶 夕夏残阳落幕 提交于 2020-07-15 10:05:47

问题


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


回答1:


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




回答2:


replace

.**

with

.*.*

result

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


来源:https://stackoverflow.com/questions/62080165/unresolved-class-name-proguard-rules-android-studio-4-0

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