安卓APK调试模式下工作正常,但释放模式赋予了太多的警告 [英] Android apk Debug mode works fine but release mode gives too many warnings
问题描述
我试图从日食得到一个签名的APK。我有工作正常,一个调试的APK版本。现在,当我试图编译并签署与Eclipse ADT版本中,我得到很多的警告,其中大部分是找不到父类或接口some.package.Class
。所以,我称之为<一个href="http://stackoverflow.com/questions/4525661/android-proguard-cant-find-dynamically-referenced-class-javax-swing">this, 这和许多其他不幸的是我无法到达的任何地方!
I'm trying to get a signed APK from eclipse. I have a debuggable apk version that works fine. Now for release when I tried to compile and sign with Eclipse ADT, I get many warnings, most of which is can't find superclass or interface some.package.Class
. So, I referred to this, this and many others unfortunately I couldn't reach anywhere!
我也得到注:有314重复类定义
警告
我的progaurd-project.txt先前不变。所以,我说 -libraryjars /库/ lib目录名
为每个罐子present在 / EcliseProject /库/
文件夹。于是我想出了以下内容:
My progaurd-project.txt was untouched earlier. So, I added -libraryjars /libs/lib-name
for each of the jars present at /EcliseProject/libs/
folder. So I came up with the following:
-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
-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
等。然后我得到了更多的警告,他们中的一些说法库班org.xmlpull.v1.XmlPullParser取决于程序类java.lang.String
。
By the end of this I got some 1800+ warnings most of them being not finding superclass or interface as mentioned above. So, I got the jars that have those classes and put them too in /lib/ folder and added -libraryjars
entries including rt.jar
, etc. Then I got even more warnings some of them saying library class org.xmlpull.v1.XmlPullParser depends on program class java.lang.String
.
我尝试添加 -dontskipnonpubliclibraryclasses
,加入一些 -dontwarn
等没有到目前为止的工作。
I tried adding -dontskipnonpubliclibraryclasses
, adding some -dontwarn
, etc. Nothing worked so far.
在某些时候,我一直在足够 -dontwarn
,这样制成的apk,但它只是提出了登录界面(第1活性),一旦点击了一个按钮卡住了有
At some point I kept sufficient -dontwarn
so that apk was made but it just brought up the login screen (1st activity) and once clicked on a button got stuck there.
我想的东西很基本的,我猜。 所有的这些天,我在测试与调试模式APK其正常工作。这是为什么麻烦?请帮助!
I'm missing something very basic I guess. All these days I was testing with debug mode apk which works normally. Why is this trouble? Please help!!
推荐答案
确定后,很多谷歌上搜索,并在搜索的计算器的本身,我必须设法得到一个解决方案。以下是我的 ProGuard的-project.txt
文件:
OK after a lot of googling and searching within stackoverflow itself, I have manages to get a solution. The following is my proguard-project.txt
file:
-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
希望它能帮助别人,谢谢!
Hope it helps others, Thanks!
这篇关于安卓APK调试模式下工作正常,但释放模式赋予了太多的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!