android 导入 eclipse,如何将现有的Android项目导入Eclipse?

File → Import → General → Existing Projects into Workspace → Next

Select root directory: /path/to/project

Projects → Select All

Uncheck Copy projects into workspace and Add project to working sets

Finish

Solved: If you want to "Create project from existing source", you need to create a new directory and then put the project directory tree into that new directory. Then point to the new directory when importing.

This error message appears when the source code you try to import is inside an existing workspace.

Put your source code in a directory OUTSIDE any existing workspace and then import

Just delete the ".project" file in your project folder (it's hidden on Linux, use "ls -a" to show), then from Eclipse, choose Create Android Project from existing source

Im not sure this will solve your problem since I dont know where it originats from, but when I import a project i go File -> Import -> Existing projects into workspace. Maybe it will circumvent your problem.

You can also use Make new > General > Project, then import the project to that project directory

It seems you cannot have your project root, with the AndroidManifest.xml deeper than one directory level below your workspace root. I struggled for an hour with this before I just gave up and rearranged my repo.

I found James Wald's answer the closest to my solution, except instead of "File->Import->General->Existing Projects into Workspace" (which did not work for me at all) I used "File->Import->Android->Existing Android Code Into Workspace". I am using Helios, maybe your version of Eclipse does not have this quirk.

I had the problem of getting errors when checking out an Android project from SVN. This is what I did and the whole thing settled down.

1. checkout the project from SVN as we normally do any other project

2. right click and get properties of the project

3. In the java build path->order and export tab select the android API and OK it

this removed all the project issues

so far so good but not sure if this is the 100% correct method

In my Android Project folder .project file was missing. Restoring the .project file,which will be hidden in Unix OS environment resolved the error.

Updating @JamesWald's answer, and incorporating other comments. Assuming you want to create a cfesh copy from, say, a backup in your new workspace:

Put the existing project in a directory not inside the destination workspace.

In Eclipse: File->Import->Android->Existing Android Code into Workspace, Next

Select root directory: /path/to/project/from/step/1

Projects->Select All (or not, as the case may be)

Make sure you set the new project name correctly - To change one click on the old project name (left column) and then click on the new project name (right column) and then edit. It will default to the class name of the Default Activity.

Assuming you want a copy in the destination workspace, check "Copy projects into workspace"

uncheck "Add project to working sets"

Finish

Same problem happened to me as well and the .project file was not there in the project.

I copied a .project file from an existing android project and replace the project name with the name of the project I am trying to import.

Then using File -> Import -> Existing projects into workspace I was able to import the project.

What works for me is that: File > Import > Existing Project into Workspace (under General tab), then choose the project root folder. The importing of Existing Android Code into Workspace somehow does not work on Eclipse for me.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值