windows Proguard 错误:需要类路径分隔符 - 不确定我需要将路径放在引号中的位置

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4356979/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 15:44:12  来源:igfitidea点击:

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

androidwindowsantproguard

提问by Mampersat

The error:

错误:

BUILD FAILED
C:\workspace\projectName\add-proguard-release.xml:35: Expecting class path separator ';' before 'Files\eclipse\android-sdk-windows\platforms\android-3\android.jar' in argument number 1

I am fully aware that my problem is that I have eclipse+android in the c:\program files\eclipse directory - and the space between 'program' and 'files' is causing this problem.

我完全意识到我的问题是我在 c:\program files\eclipse 目录中有 eclipse+android - 并且“程序”和“文件”之间的空间导致了这个问题。

I am also aware that a solution is to put this path in quotes.

我也知道一个解决方案是将此路径放在引号中。

My problem is WHERE to put these quotes. I'm a bit of an ANT noob: and am following the directions I found here: http://android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html

我的问题是在哪里放置这些引号。我有点像 ANT 菜鸟:我正在按照我在这里找到的说明进行操作:http: //android-developers.blogspot.com/2010/09/proguard-android-and-licensing-server.html

I'm currently trying to figure out enough more about how ANT works with PROGUARD to know where to wrap a path with quotes - and how (I'm worried it's in XML and not sure what kind of processing is going to happen to escape characters etc)

我目前正试图更多地了解 ANT 如何与 PROGUARD 一起工作,以知道在哪里用引号包裹路径 - 以及如何(我担心它是在 XML 中并且不确定会发生什么样的处理来转义字符等等)

I have as a backup plan to move everything out of "program files" - but I'd really like to solve this problem correctly, and feel moving the project is a hack/admitting defeat.

我有将所有内容从“程序文件”中移出的备用计划 - 但我真的很想正确解决这个问题,并且觉得移动项目是一种黑客/承认失败。

回答by Mark

In Eclipse: Window > Preferences > Android > SDK Location

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

在 Eclipse 中:窗口 > 首选项 > Android > SDK 位置

使用类似 c:\Progra~1\android-sdk (或者在 64 位上使用 c:\Progra~2\android-sdk)

回答by olafure

This worked for me:

这对我有用:

add following line to your default.properties file:

将以下行添加到您的 default.properties 文件中:

external.libs.dir=libs

external.libs.dir=libs

Source: http://zed.0xff.me/2010/12/22/expecting-class-path-separator-before-in-argument-number-1

来源:http: //zed.0xff.me/2010/12/22/expecting-class-path-separator-before-in-argument-number-1

回答by ef2011

ProGuard doesn't like paths that contain spaces. I therefore always install the Android SDK directly under C:\ ==> C:\android-sdk-windows.

ProGuard 不喜欢包含空格的路径。因此,我总是直接在 C:\ ==> 下安装 Android SDK C:\android-sdk-windows

回答by Muzikant

Add sdk.dir=C:\\Progra~1\\Eclipse\\android-sdk-windowsto your local.properties file.

添加sdk.dir=C:\\Progra~1\\Eclipse\\android-sdk-windows到您的 local.properties 文件中。

Make sure the path matches the one on your machine

确保路径与您机器上的路径匹配

回答by Hikmat Khan

OK , now i found one way to fix this problem 1, set up the "PROGUARD_HOME" EVN PATH to \tools\proguard 2, restart eclipse 3, now it work fine!

好的,现在我找到了解决此问题的一种方法 1,将“PROGUARD_HOME”EVN PATH 设置为 \tools\proguard 2,重新启动 eclipse 3,现在它可以正常工作了!

回答by mbafford

If you're specifying the paths for the Android SDK and Proguard locations manually, you can always use the short form of the path:

如果您手动指定 Android SDK 和 Proguard 位置的路径,则始终可以使用路径的缩写形式:

c:\progra~1\eclipse

c:\progra~1\eclipse

It's a throw-back to the age old days of Windows long file names, but it still works in at least up to XP (and I believe later, but I haven't used 7 or Vista enough to be sure).

这是对旧时代的 Windows 长文件名的倒退,但它至少在 XP 中仍然有效(我相信后来,但我还没有使用 7 或 Vista 来确定)。

As for the quotes, I don't know - I'm on Linux primarily, and on Windows I made it a point to never put spaces in my paths for development projects - too many things have issues with that.

至于引号,我不知道——我主要使用 Linux,而在 Windows 上,我强调永远不要在我的开发项目路径中放置空格——太多事情都存在问题。