如何抑制';也许这就是程序方法';来自ProGuard的警告

如何抑制';也许这就是程序方法';来自ProGuard的警告,proguard,Proguard,我正在将ProGuard与我的Android应用程序一起使用,并在我的构建日志中运行以下警告。我已经在proguard.cfg文件中添加了相应的“-keep public class com.foo.OtherClass{public static*;}”语句,但仍然收到警告。我的应用程序运行良好,可以正确地动态访问类。是否可以抑制这些警告 [proguard] Note: com.foo.MyClass accesses a method 'getInstance()' dynamically

我正在将ProGuard与我的Android应用程序一起使用,并在我的构建日志中运行以下警告。我已经在proguard.cfg文件中添加了相应的“-keep public class com.foo.OtherClass{public static*;}”语句,但仍然收到警告。我的应用程序运行良好,可以正确地动态访问类。是否可以抑制这些警告

[proguard] Note: com.foo.MyClass accesses a method 'getInstance()' dynamically
[proguard]       Maybe this is program method 'com.foo.OtherClass { com.foo.OtherClass getInstance(); }'

您可以通过在配置中明确提及方法来避免:

-keep class com.foo.OtherClass { com.foo.OtherClass getInstance(); }
或者,可以抑制类上的注释:

-dontnote com.foo.MyClass

通过添加以下行,可以抑制所有Notes类型的邮件:

-dontnote **

即使这样对我也没有帮助。不要忘记
**
。一开始我就被绊倒了。