解决: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" %*

再次进行打包混淆,没有出现异常

PS:如果还有问题把proguardgui.bat文件里的路径和 proguard.bat作同样的编辑
已标记关键词 清除标记
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页