Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import eclipse project to Android studio - error "this project refers to Eclipse workspace..."

I tried to import an existing project eclipse to Android Studio, but I got a dialog message in import that I can't solve : "this project refers to Eclipse workspace relative path in its project metadata. To help import the project, please point to an Eclipse workspace directory."

please check screenshots

enter image description here enter image description here

How I can solve it?

Thanks so much in advance

like image 504
Zeta Avatar asked Jan 28 '16 18:01

Zeta


People also ask

How do I import a project into Android Studio?

Launch Android Studio, and click File > New > Import Project. Locate your project directory, click the build. gradle file you created above to select it, and then click OK to import your project.


2 Answers

Simply delete all the folders and files from your project except manifest res,src and then import it in Android studio using Import from eclipse

like image 158
Pratik Avatar answered Sep 28 '22 00:09

Pratik


I have same error. Let me explain all steps. You have Eclipse project and you want to import in Android Studio. So when you try to import it it will ask you to generate project at different location as shown below.

Import Eclipse project

when you click on next it will show you this screen.

Replace all libraries

after proceeding you will get this screen.

enter image description here

now the question is why it ask for Eclipse workspace path?

Answer: There is hidden .classpath file in your Eclipse project. the .classpath file contains information that the JDT feature needs in order to properly compile the project: the project's source folders (that is, what to compile); the output folders (where to compile to); and classpath entries (such as other projects in the workspace, arbitrary JAR files on the file system, and so forth).

First you have to select original Eclipse project path in Eclipse workspace path then you need to edit all file paths which is shown list. File names which are mentioned on left are already existed in original Eclipse project you have to set path so Android Studio will able to import project.

I have solved by this approach. Please let me know if you get any other error.

like image 34
Rajesh Avatar answered Sep 28 '22 00:09

Rajesh