簡體   English   中英

Android-Proguard返回了錯誤代碼1

[英]Android - Proguard returned with error code 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

在取消上述建議的行之后,我嘗試導出未簽名的應用程序。 但是出現了出口錯誤, 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或錯過了步驟?

根本原因在堆棧跟蹤中列出:

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)
...
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream 
    at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:223)
    ...

您應該檢查以下內容:

  • 給定位置是否存在文件abslibrary.jar
  • 它是有效的罐子(可以用一些解壓縮工具將其打開)嗎?
  • 是在構建過程中編寫的嗎? 如果是以某種方式異步編寫的,則ProGuard讀取時它可能仍不完整。

我通過注釋-libraryjars來解決這個問題,該jars找不到。文件說不會存在jar,它將在運行時加載jar。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM