Android Eclipse Import Existing Code

2019-02-04 05:11发布

I am trying to organize my code for SVN so I can work from multiple locations without issue and potentially add more developers. The problem is that I can't get the code into a new project easily. I am trying to create a project from existing code.

Once I select the folder, the "main activity" shows up, but I can never use it. I've tried deleting all the .project files and what not in the folder as well, but the thing is always greyed out and I can never get it to import.

Why is it greyed out? What do I need to do to get it to import?

-- ADT Build v21.0.0-519525

Import Projects Grey

6条回答
Emotional °昔
2楼-- · 2019-02-04 05:50

It's grayed because project name equals to the name of existing project within workspace. Solution: Use "Existing Android Code Into Workspace" import. Type "Root Directory". Change "New Project Name" field directly in Import Projects wizard. Do the following: first press path text (right from checkbox) in "Project to Import" field then go to "New Project Name" field to change name.

查看更多
时光不老,我们不散
3楼-- · 2019-02-04 05:52

I had a hard time with the same problem with TrivialDrive. Try to check "Main Activity" from the project names you have in your workspace. if it exist, you'll get this error.

查看更多
做个烂人
4楼-- · 2019-02-04 06:07

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. It worked for me..

Thats it.Cheerzz..

查看更多
\"骚年 ilove
5楼-- · 2019-02-04 06:13

I played around with this a bunch and found out that it was conflicting with another similarly named activity that already existed in the workspace. The error message "Select at least one project" was covering up that message. It would appear very quickly and then switch to select at least one project.

To get around this, I deleted all the projects from my workspace. I didn't know which one it was because I am making an app that is being versioned and branded for different companies.

查看更多
对你真心纯属浪费
6楼-- · 2019-02-04 06:13

I had this problem when I needed to build an apk file as a one-off from an svn tag. I managed it by creating a new workspace and switching to it. After that New->Project->Android->Android Application From Existing Code worked as you would hope.

查看更多
等我变得足够好
7楼-- · 2019-02-04 06:16

Solution A:

1) Close Eclipse, 2) when it starts it will ask for new working directory, choose something different then your default one.

if it is not asking for "new working directory"

Solution B: 1) Go to File > Switch Workspace > Other 2) Choose a new Working-Directory (not the same!)

enter image description here

After that it should be possible importing projects

查看更多
登录 后发表回答