Using Proguard for Android in Eclipse got Error

2019-03-17 11:13发布

I have taken a fresh install of Eclipse and all the latest Android tools and want to use Proguard on existing project, but for now I have created a new blank one. I have added a proguard.cfg file to my project added proguard.config=proguard.cfg to my default.properties

Now when I try to export I get the following error

[2010-12-12 10:36:35 - ApplicationTest] Proguard returned with error code 1. See console
[2010-12-12 10:36:35 - ApplicationTest] 'C:\Program' is not recognized as an internal or external command,
[2010-12-12 10:36:35 - ApplicationTest] operable program or batch file.
[2010-12-12 10:36:35 - ApplicationTest] '-jar' is not recognized as an internal or external command,
[2010-12-12 10:36:35 - ApplicationTest] operable program or batch file.

I know it means there is a filepath setup incorrectly, question is where the heck is as I have looked through the general properties and project properties and can't see any reference to proguard or obfuscation so am stuck on what to change

Any help appreciated.

7条回答
迷人小祖宗
2楼-- · 2019-03-17 11:38

You need to define your Android SDK path without spaces. Copy&Paste from this answer by Mark:

Proguard error: Expecting class path seperator - not sure where I need to put a path in quotes

Yep, that worked for me. To put it specifically:

In Eclipse: Window > Preferences > Android > SDK Location

use something like c:\Progra~1\android-sdk (or maybe c:\Progra~2\android-sdk on 64bit)

For me the path is "c:\Progra~1\Android\android-sdk-windows"

查看更多
登录 后发表回答