1. 程式人生 > >解決:Error: Unable to access jarfile ..\lib\proguard.jar

解決:Error: Unable to access jarfile ..\lib\proguard.jar

今天無意升級了ADT到ADT 22.6,打包混淆的時候就出現了問題:

Proguard returned with error code 1. See console Error: Unable to access jarfile ..\lib\proguard.jar 一直找不到問題的解決方案,後來我把proguard(下載地址:http://sourceforge.net/projects/proguard/files/proguard/)也升級到最新版還是不行。 後來我仔細看了一下報錯資訊,我覺的是路徑的問題,我就試著將 D:\android-sdk-windows\tools\proguard\bin\proguard.bat 開啟內容如下: @ECHO OFF REM Start-up script for ProGuard -- free class file shrinker, optimizer, REM obfuscator, and preverifier for Java bytecode. REM REM Note: when passing file names containing spaces to this script, REM      you'll have to add escaped quotes around them, e.g. REM      "\"C:/My Directory/My File.txt\"" IF EXIST "%PROGUARD_HOME%" GOTO home SET PROGUARD_HOME=..
:home java -jar "%PROGUARD_HOME%\lib\proguard.jar" %* 我試著改了一下 @ECHO OFF REM Start-up script for ProGuard -- free class file shrinker, optimizer, REM obfuscator, and preverifier for Java bytecode. REM REM Note: when passing file names containing spaces to this script, REM      you'll have to add escaped quotes around them, e.g. REM      "\"C:/My Directory/My File.txt\"" IF EXIST "%PROGUARD_HOME%" GOTO home SET PROGUARD_HOME="D:\android-sdk-windows\tools\proguard"
:home java -jar "%PROGUARD_HOME%\lib\proguard.jar" %* 再次進行打包混淆,沒有出現異常