Android项目导出时出现Proguard错误-系统找不到指定文件
在发布 Android 应用程序之前,我想通过 proguard 运行它。当尝试使用 progaurd 构建时,我收到一个错误:
[2011-07-26 11:11:17 - app_name] Error: C:\Users\User\Galileo (The system cannot find the file specified)
在阅读了一些线程后,我发现如果路径有空格,progaurd 将无法工作。好吧,Eclipse 创建的默认工作区有一个空格:
c:\Users\User\Galileo Workspace\
因此,我转到工作区文件夹并将工作区文件夹的名称从: 更改
Galileo Workspace
为:
Galileo_workspace
...因此从路径中删除了空格。
当我这样做时,发生了两件事......找不到我的工作区(没什么大不了的,只需切换工作区即可纠正此问题)。问题是我的所有别名信息都消失了。其中最大的问题是:
当尝试使用我在更改工作区之前创建的密钥库导出我的 Android 项目时,它们不再工作。
如何更改工作区文件夹的名称并删除路径中的空格,以便我的别名或现有密钥库不受影响?
Before I publish an Android app I'd like to run it through proguard. When attempting to build with progaurd I receive an error:
[2011-07-26 11:11:17 - app_name] Error: C:\Users\User\Galileo (The system cannot find the file specified)
After reading through some threads I found that progaurd won't work if the path has spaces. Well, the default workspace that Eclipse created has a space:
c:\Users\User\Galileo Workspace\
So, I went to the workspace folder and changed the name of the workspace folder from:
Galileo Workspace
to:
Galileo_workspace
...hence removing the space from the path.
When I did this, two things happened.....my workspace couldn't be found (not a big deal, just switching the workspace corrects this issue). The problem is that all of my alias information is gone. And the biggest problem of them all:
When trying to export my android projects with keystores I've created before changing the workspace, they no longer work.
How can I change the name of my workspace folder and remove the space in the path so that none of my aliases or existing keystores are affected?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在default.properties文件中,我最初告诉Eclipse在哪里看起来像这样:
我更改了这一行来告诉Eclipse整个路径像这样并且项目成功构建:
有人知道为什么吗?是我的工作区文件夹路径中的空格导致了初始错误还是我的 Eclipse 设置?
In default.properties file, I was originally telling eclipse where to look like this:
I changed this line to tell the eclipse the entire path like this and the project was successfully built:
Anyone know why? Is it the space in the path to my workspace folder that caused the initial error or could it be my Eclipse setup?
关于您原来的问题:您应该尝试升级到 Android SDK R12。路径中的空格问题已在更新的 Ant 配置文件 (android-sdk/tools/ant/main_rules.xml; Android 问题 16674)。
Regarding your original problem: you should try upgrading to Android SDK R12. The problem with spaces in paths has been solved in the updated Ant configuration file (android-sdk/tools/ant/main_rules.xml; android issue 16674).
我尝试了 @dell116 答案,但它对我不起作用,但我意识到路径中的“空格”字符是问题所在,因此如果您要导出 apk 的项目位于您的工作区中,您可以切换工作空间路径与旧工作空间路径相同,但将每个 (SPACE) 替换为 (~)。
但是,如果您的项目有自己的路径,您可以使用右键单击您的项目名称来
为您的项目选择另一个不带空格的路径,然后它将把您的项目移动到新路径中,一切都会好起来的。
I tried @dell116 answer but it didn't work for me, but I realized that the "space" charachter in the path is the problem, so if the project that you want to export the apk for is in your workspace you may switch the workspace path to the same old one but replacing each (SPACE) with (~).
But if your project has its own path you may use Right-Click your project name in
choose another path for your project without spaces then it will move your project in the new path and every thing will be OK.