Android/Eclipse 将工作区从一台计算机移动到另一台计算机
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8337850/
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
Android/Eclipse moved workspace from one computer to another computer
提问by Nathan Morales
https://stackoverflow.com/a/4953458/1074880I followed these instruction but didn't know what file to select after checking in my project properties.
https://stackoverflow.com/a/4953458/1074880我按照这些说明操作,但在检查我的项目属性后不知道要选择哪个文件。
Properties > Libraries (Unable to get system library for the project, Access rules: No rules defined, Native library location: (None)) > Add External JARs > program file > java > jre6 is it lib or bin then what do I select after that?
属性 > 库(无法获取项目的系统库,访问规则:未定义规则,本机库位置:(无))> 添加外部 JAR > 程序文件 > java > jre6 是 lib 还是 bin 然后我选择什么那?
Errors:
错误:
Description Resource Path Location Type The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project Unknown Java Problem The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project Unknown Java Problem The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files Unable to resolve target 'android-8' Unknown Android Target Problem Unable to resolve target 'android-8' until the SDK is loaded. Unknown Android Target Problem Unable to resolve target 'Google Inc.:Google APIs:8' Unknown Android Target Problem Unable to resolve target 'Google Inc.:Google APIs:8' until the SDK is loaded. Unknown Android Target Problem
说明 资源路径 位置类型 项目未构建,因为其构建路径不完整。找不到 java.lang.Object 的类文件。修复构建路径,然后尝试构建此项目 未知 Java 问题 项目未构建,因为其构建路径不完整。找不到 java.lang.Object 的类文件。修复构建路径,然后尝试构建此项目 Unknown Java Problem 无法解析类型 java.lang.Object。它是从所需的 .class 文件间接引用的,无法解析类型 java.lang.Object。它是从所需的 .class 文件中间接引用的 无法解析目标 'android-8' 未知的 Android 目标问题 在加载 SDK 之前无法解析目标 'android-8'。未知的 Android 目标问题 无法解析目标 'Google Inc.:Google APIs:8' 未知的 Android 目标问题 无法解析目标 'Google Inc.:Google APIs:8' 直到加载 SDK。未知的 Android 目标问题
回答by Warpzit
One solution is simply to import project. Then clean, if it doesn't work, delete project, then import again. I assume you click copy content to local when you import.
一种解决方案是简单地导入项目。然后clean,如果不行就删项目,再导入。我假设您在导入时单击了将内容复制到本地。
Another solution is to make a new android project and select create project from existing source.
另一种解决方案是创建一个新的 android 项目并选择从现有源创建项目。
Whatever solution is used you still sometimes have to do it multiple times for it to work...
无论使用什么解决方案,您有时仍然需要多次执行才能使其工作...
回答by Mit Bhatt
Here are the some steps If you want to move your project to one PC to other, hope this help. When you are copy to Pen drive or Hard drive follow these steps
以下是一些步骤 如果您想将您的项目从一台 PC 移到另一台 PC,希望对您有所帮助。当您复制到笔式驱动器或硬盘驱动器时,请按照以下步骤操作
- Open Eclipse and switch to Workspace1 using Switch To Workspace...
- Check the projects in Workspace1
- Switch to another workspace to make sure that Workspace1 is closed completely by Eclipse (Critical step!)
- Quit Eclipse
- Copy Workspace1 and name the copy Workspace2
- Copy Workspace2 to a USB flash drive
- Copy Workspace2 from the USB flash drive onto the hard disk of a different computer
- Open Eclipse on the new computer
- Switch to Workspace2 using Switch To Workspace...
- 打开 Eclipse 并使用 Switch To Workspace... 切换到 Workspace1
- 检查 Workspace1 中的项目
- 切换到另一个工作区以确保 Workspace1 被 Eclipse 完全关闭(关键步骤!)
- 退出 Eclipse
- 复制 Workspace1 并命名副本 Workspace2
- 将 Workspace2 复制到 U 盘
- 将 Workspace2 从 USB 闪存驱动器复制到另一台计算机的硬盘上
- 在新电脑上打开 Eclipse
- 使用 Switch To Workspace... 切换到 Workspace2
The projects open normally from Eclipse on any machine as though that workspace had been there all along. The critical step seems to be switching to another workspace before quitting Eclipse. If you skip that step the copied and transferred workspace does not open correctly.
项目可以在任何机器上从 Eclipse 正常打开,就好像该工作区一直存在一样。关键步骤似乎是在退出 Eclipse 之前切换到另一个工作区。如果跳过该步骤,复制和传输的工作区将无法正确打开。

