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


11down votefavorite

2

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

时间: 2024-10-07 08:17:39

How to suppress 'Maybe this is program method' warnings from ProGuard的相关文章

Google JavaScript Style Guide

转自:http://google.github.io/styleguide/javascriptguide.xml Google JavaScript Style Guide Revision 2.93 Aaron Whyte Bob Jervis Dan Pupius Erik Arvidsson Fritz Schneider Robby Walker Each style point has a summary for which additional information is ava

函数附加练习2

1.写一个函数,使输入的一个字符串按反序存放,在主函数中输入和输出字符串. 主要代码: static void Main(string[] args) { Program method = new Program(); ArrayList a = new ArrayList(); Console.Write("请输入长度:"); int n = int.Parse(Console.ReadLine()); for (int i = 0; i < n; i++) a.Add(Con

函数1

十四.函数 (一)定义 1.定义与格式 函数即方法 class Program { //格式一:没有返回值,没有参数 public void qiuhe() { Console.Write("请输入一个数:"); int a = int.Parse(Console.ReadLine()); int sum = 0; for (int i = 1; i <= a; i++) { sum += i; } Console.WriteLine(sum); } //格式二:没有返回值,有参

Java注解(二) 系统注解

上一篇博文讲了Java注解是什么.有什么作用.现在让我们来谈谈Java本身提供的一些注解,包括内置注解跟元注解(后面解释). 概要 系统注解 内置注解 @Deprecated @Override @SuppressWarnings 元注解 @Retention @Target @Inherited @Documented 内置注解 Java本身提供了一些比较常用的注解,下面就分别介绍一下@Deprecated.@Override.@SuppressWarnings. @Deprecated 作用

Effective Java 69 Prefer concurrency utilities to wait and notify

Principle Use the higher-level concurrency utilities instead of wait and notify for easiness. Use ConcurrentHashMap in preference to Collections.synchronizedMap or Hashtable. Use concurrent collections in preference to externally synchronized collect

Google JavaScript规范

前言 此文档为翻译google的标准javascript规范 请与以下原文对照阅读 有异议的地方以原文为准 原文地址google javascript规范 http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml 文中推荐使用的工具是google推荐使用的,请根据实际情况选用 文中定义的很多格式主要是为了考虑js文件编译(js最小化)的问题,如果在项目中考虑使用 js文件编译 请尽量遵守 此文档不仅仅是一份编码风格

flink流计算随笔(2)

MACOS下安装flink: $ brew install apache-flink ... $ flink --version $brew upgrade MACOS下启动flink: $cd /usr/local/Cellar/apache-flink/1.6.0 $./libexec/bin/start-cluster.sh /* * Licensed to the Apache Software Foundation (ASF) under one * or more contribut

C++抽象类实践

实践如下: #include <iostream> using namespace std; class Service { public: // 有一个虚函数即为抽象类 int id; // 不定义虚析构函数 会报右侧异常:@suppress("Class has a virtual method and non-virtual destructor") virtual ~Service(){} virtual double calc()=0; int aa(){ ret

golang Methods on structs

原文:http://golangtutorials.blogspot.com/2011/06/methods-on-structs.html snmp 下载,有空学习一下! https://sourceforge.net/projects/net-snmp/ -------------------------------------------------------------------------------------------------------- Methods on stru