使用proGuard时如何保持java.lang.reflect
How to keep java.lang.reflect when use proGuard
在我的应用程序中,我想使用这个 库 :https://github.com/xmuSistone/AndroidPileLayout
我想在我的项目中使用 proguard
,当 proguard
我的项目向我显示可能存在错误时。
对于修复 proguard
,库开发人员说:
proguard works wrong when you are using java.lang.reflect api, please
check your own code.
如何修复它并保留 java.lang.reflect
?
请帮帮我
反射需要有绝对路径 类 及其各自的方法。所以,你需要告诉混淆器不要管你需要的东西。您可以在 proguard-rules.pro
文件中对此进行描述。
示例:
-keep public class fully_qualified_classname
-keepclassmembers public class fully_qualified_classname {
# will ignore all methods
public <methods>;
public static final String static_instance_variable_if_any;
}
在我的应用程序中,我想使用这个 库 :https://github.com/xmuSistone/AndroidPileLayout
我想在我的项目中使用 proguard
,当 proguard
我的项目向我显示可能存在错误时。
对于修复 proguard
,库开发人员说:
proguard works wrong when you are using java.lang.reflect api, please check your own code.
如何修复它并保留 java.lang.reflect
?
请帮帮我
反射需要有绝对路径 类 及其各自的方法。所以,你需要告诉混淆器不要管你需要的东西。您可以在 proguard-rules.pro
文件中对此进行描述。
示例:
-keep public class fully_qualified_classname
-keepclassmembers public class fully_qualified_classname {
# will ignore all methods
public <methods>;
public static final String static_instance_variable_if_any;
}