Proguard error during Android project export - System cannot find the specified file
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-2开发者_如何学C6 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?
In default.properties file, I was originally telling eclipse where to look like this:
proguard.config=proguard.cfg
I changed this line to tell the eclipse the entire path like this and the project was successfully built:
proguard.config=/project_folder/proguard.cfg
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?
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).
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
Eclipse > Refactor > Move > then
choose another path for your project without spaces then it will move your project in the new path and every thing will be OK.
精彩评论