如何抑制“也许这就是程序方法”?来自 ProGuard 的警告
我在 Android 应用程序中使用 ProGuard,并且在构建日志中收到以下警告。我添加了适当的 '-keep public class com.foo.OtherClass { public static *; }' 声明到我的 proguard.cfg 文件中,但我仍然收到警告。我的应用程序运行良好并且可以正确动态访问该类。是否可以抑制这些警告?
[proguard] Note: com.foo.MyClass accesses a method 'getInstance()' dynamically
[proguard] Maybe this is program method 'com.foo.OtherClass { com.foo.OtherClass getInstance(); }'
I'm using ProGuard with my Android application and I'm running getting the warnings below in my build log. I've added the appropriate '-keep public class com.foo.OtherClass { public static *; }' statement to my proguard.cfg file, but I still get the warnings. My app runs fine and is dynamically accessing the class correctly. Is it possible to suppress these warnings?
[proguard] Note: com.foo.MyClass accesses a method 'getInstance()' dynamically
[proguard] Maybe this is program method 'com.foo.OtherClass { com.foo.OtherClass getInstance(); }'
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过在配置中明确提及该方法来避免这种情况:
或者,您可以隐藏类上的注释:
You can avoid it by explicitly mentioning the method in the configuration:
Alternatively, you can suppress notes on a class:
您可以通过添加以下行来抑制所有 Note 类型的消息:
You suppress all messages of type Note by adding the following line: