本文介绍了Proguard:找不到引用的类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有几个问题,但没有适用于我的解决方案。我认为这很容易使用。
我只是得到一个充满的控制台找不到引用的类
There are a few questions around but no solution that works for me. I thought it was suppose to be easy to use.I just get a console full of can't find referenced class
这是我的程序 - project.txt
This is my proguard-project.txt
-injars bin/classes
-injars libs
-outjars bin/classes-processed.jar
-libraryjars C:/Users/ME/android-sdks/platforms/android-10/android.jar
-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers class * implements android.os.Parcelable {
static android.os.Parcelable$Creator CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
和project.properties
and project.properties
#Proguard enabled
proguard.config=C:/Users/ME/android-sdks/tools/proguard/proguard-android.txt:proguard-project.txt
一些有警告的课程是:
org.apache.avalon.framework.logger.Logger
org.apache.log4j.Category
org.apache.log4j.Priority
org.apache.log4j.Logger
...
javax.servlet.ServletContextListener
javax.servlet.ServletContextEvent
org.w3c.dom.html.HTMLAnchorElement
org.w3c.dom.html.HTMLObjectElement
org.w3c.dom.html.HTMLTableSectionElement
org.w3c.dom.html.HTMLFrameSetElement
...
org.w3c.dom.events.DocumentEvent
org.w3c.dom.traversal.NodeFilter
...
org.w3c.dom.ranges.Range
org.w3c.dom.ranges.RangeException
...
org.w3c.dom.html.HTMLDocument
推荐答案
添加到您的配置:
-libraryjars org.apache.jar // name of your jars.
-libraryjars org.w3c.jar
如果无效则添加:
-dontwarn org.apache.** tag
或者只是忽略警告(非常不推荐,因为它可能导致你的应用程序在运行时因不满意的依赖项而崩溃):
or just ignore warnings (highly unrecommended since it could cause your app to crash at runtime over unsatisfied dependencies):
-ignorewarnings
此文档将帮助您:
这篇关于Proguard:找不到引用的类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!