ran*_*ose 5 eclipse android proguard adt release-mode
我正试图从eclipse获得一个签名的APK.我有一个可调试的apk版本,工作正常.现在,当我尝试使用Eclipse ADT进行编译和签名时,我会收到许多警告,其中大部分是警告can't find superclass or interface some.package.Class.所以,我提到这个,这个和其他许多不幸的是我无法到达的任何地方!
我也得到Note: there were 314 duplicate class definitions.警告
我的progaurd-project.txt早先没有动过.所以,我-libraryjars /libs/lib-name为/EcliseProject/libs/文件夹中的每个罐子添加了.所以我想出了以下内容:
-libraryjars /libs/android-support-v4.jar
-libraryjars /libs/apache-mime4j-core-0.7.2.jar
-libraryjars /libs/gcm.jar
-libraryjars /libs/httpclient-4.3.3.jar
-libraryjars /libs/httpcore-4.3.2.jar
-libraryjars /libs/httpmime-4.3.3.jar
-libraryjars /libs/library.jar
-libraryjars /libs/nineoldandroids-2.4.0.jar
到最后,我得到了1800多个警告,其中大多数都没有找到上面提到的超类或接口.所以,我得到了那些有这些类的罐子,并将它们放在/ lib /文件夹中,并添加了-libraryjars包括rt.jar等的条目.然后我得到了更多的警告,其中一些人说library class org.xmlpull.v1.XmlPullParser depends on program class java.lang.String.
我尝试添加-dontskipnonpubliclibraryclasses,添加一些-dontwarn等等.到目前为止没有任何工作.
在某些时候,我保持足够,-dontwarn以便制作apk,但它只是提起登录屏幕(第一个活动),一旦点击按钮就卡在那里.
我想我错过了一些非常基本的东西.这些天我一直在测试调试模式apk正常工作.为什么这个麻烦?请帮忙!!
好吧,在stackoverflow本身进行了大量谷歌搜索和搜索之后,我设法找到了解决方案。以下是我的proguard-project.txt文件:
-libraryjars /libs/android-support-v4.jar
-libraryjars /libs/apache-mime4j-core-0.7.2.jar
-libraryjars /libs/gcm.jar
-libraryjars /libs/httpclient-4.3.3.jar
-libraryjars /libs/httpcore-4.3.2.jar
-libraryjars /libs/httpmime-4.3.3.jar
-libraryjars /libs/library.jar
-libraryjars /libs/nineoldandroids-2.4.0.jar
-keepnames class org.apache.** {*;}
-keep public class org.apache.** {*;}
-dontwarn org.apache.commons.**
-dontwarn org.apache.http.annotation.ThreadSafe
-dontwarn org.apache.http.annotation.Immutable
-dontwarn org.apache.http.annotation.NotThreadSafe
-dontwarn org.apache.http.impl.auth.GGSSchemeBase
-dontwarn org.apache.http.impl.auth.KerberosScheme
-dontwarn org.apache.http.impl.auth.NegotiateScheme
-dontwarn org.apache.http.impl.auth.KerberosScheme
-dontwarn org.apache.http.impl.auth.SPNegoScheme
-dontwarn se.emilsjolander.stickylistheaders.StickyListHeadersListView
-dontwarn android.net.http.AndroidHttpClient
Run Code Online (Sandbox Code Playgroud)
希望对其他人有帮助,谢谢!