我希望我的應用程序受到progaurd保護。爲此,我去將向您介紹一些教程,職位和從this帖最後我才知道,我只能這樣做:Android - Proguard返回錯誤代碼1
If you're using ADT 17 or newer, the documentation is slightly inaccurate. The generated file is proguard-project.txt and will be in the root directory of your project.
To enable Proguard, you will need to ignore the "do not modify" warning in project.properties and uncomment the following line:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
uncommeting上述建議行我試圖出口未簽名應用後。但有一個出口錯誤說progaurd returned error with code 1
。當我點擊了錯誤對話框中的詳細信息按鈕,我得到了如下圖所示的錯誤日誌:
Proguard returned with error code 1. See console
Proguard Error 1
Output:
You should check if you need to specify additional program jars.
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [acra-
4.4.0.jar:META-INF/MANIFEST.MF])
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry
[libGoogleAnalyticsV2.jar:META-INF/MANIFEST.MF])
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry [google-play-
services_lib.jar:META-INF/MANIFEST.MF])
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry
[vpilibrary.jar:META-INF/MANIFEST.MF])
Warning: can't write resource [META-INF/MANIFEST.MF] (Duplicate zip entry
[abslibrary.jar:META-INF/MANIFEST.MF])
java.io.IOException: Can't write [C:\Users\SURESH\AppData\Local\Temp
\android_6223056648746329994.jar] (Can't read [C:\Users\SURESH\Desktop\ActionBarSherlock-
4.2.0\ABSlibrary\bin\abslibrary.jar] (Unexpected end of ZLIB input stream))
at proguard.OutputWriter.writeOutput(OutputWriter.java:264)
at proguard.OutputWriter.execute(OutputWriter.java:160)
at proguard.ProGuard.writeOutput(ProGuard.java:372)
at proguard.ProGuard.execute(ProGuard.java:153)
at proguard.ProGuard.main(ProGuard.java:492)
Caused by: java.io.IOException: Can't read [C:\Users\SURESH\Desktop\ActionBarSherlock-
4.2.0\ABSlibrary\bin\abslibrary.jar] (Unexpected end of ZLIB input stream)
at proguard.InputReader.readInput(InputReader.java:230)
at proguard.InputReader.readInput(InputReader.java:200)
at proguard.OutputWriter.writeOutput(OutputWriter.java:253)
... 4 more
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:223)
at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:141)
at java.util.zip.ZipInputStream.read(ZipInputStream.java:154)
at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:100)
at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:78)
at proguard.io.JarReader.read(JarReader.java:58)
at proguard.io.DirectoryPump.readFiles(DirectoryPump.java:65)
at proguard.io.DirectoryPump.pumpDataEntries(DirectoryPump.java:53)
at proguard.InputReader.readInput(InputReader.java:226)
... 6 more
任何想法,爲什麼會出現這種情況?我正確配置progaurd或錯過了步驟?
其實我第一次得到上述錯誤。當我第二次嘗試導出時,它正常導出,並繼續進行簽名過程。在完成簽名過程後,我試圖在設備上測試應用程序,應用程序在啓動時立即崩潰。這是崩潰logcat消息http://pastebin.com/TWbjsNp3 – 2013-02-11 06:03:26
@suresh這是一個不同的問題。 SILENT字段通過反射訪問。您應該使用-keep選項來保存它。請參閱ProGuard手冊。 – 2013-02-14 09:38:33
如果我的Android應用程序在ProGuard進程中引用另一個Android庫項目,我會得到相同的錯誤。 – Alanmars 2014-04-17 06:22:54