码迷,mamicode.com
首页 > 其他好文 > 详细

How to suppress 'Maybe this is program method' warnings from ProGuard

时间:2017-07-11 20:59:24      阅读:148      评论:0      收藏:0      [点我收藏+]

标签:was   post   any   for   research   div   getting   off   effort   

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(); }‘

 

15down voteaccepted

You can avoid it by explicitly mentioning the method in the configuration:

-keep class com.foo.OtherClass { com.foo.OtherClass getInstance(); }

Alternatively, you can suppress notes on a class:

-dontnote com.foo.MyClass

How to suppress 'Maybe this is program method' warnings from ProGuard

标签:was   post   any   for   research   div   getting   off   effort   

原文地址:http://www.cnblogs.com/xuxiuxiu/p/7152002.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!