简体   繁体   中英

How do I open my existing Eclipse projects in Android Studio?

Switching to Android Studio with all my existing projects in Eclipse. So what is the procedure to do that.

Export from Eclipse

1.Update your Eclipse ADT Plugin (you must have version 22.0 or higher).

2.In Eclipse, select File > Export.

3.In the window that appears, open Android and select Generate Gradle build files.

4.Select the projects you want to export for Android Studio and click Finish.

Your selected projects remain in the same location but now contain a build.gradle file and are ready for Android Studio.

Import into Android Studio

1.In Android Studio, select File > Import Project.

2.Locate a project you exported from Eclipse, select the project's root directory and click OK.

3.Select Create project from existing sources and click Next.

4.Follow the walk-through to complete the import process.

for more info clickhere

some FAQ Eclipse Migration FAQ

Migrating to Android Studio

The official release of Android Studio (version 1.0.2 at the time of this writing) now supports importing ADT projects directly. In fact, when trying to export from ADT, there is now a popup that suggests importing directly from Android Studio is a better choice.

Just open Android Studio > Import Non-Android Studio Projects > Select your ADT project folder.

It creates a new AS-version of your project, and reports items that need your manual verification.

Try these steps for importing an Eclipse project into Android studio:

1- Click on import project (Eclipse ADT, Gradle, etc.).

在此处输入图片说明

2- Choose the root folder of your project. The folder that contains bin folder.

在此处输入图片说明

3- Choose where you want to import it and click next.

在此处输入图片说明

4- Click on finish.

在此处输入图片说明 在此处输入图片说明

5- Change the view to project.

在此处输入图片说明

6- Open build.gradle in your src folder.

在此处输入图片说明

7- You should find out your current SDK version. So, click on tools-> Android-> SDK Manager-> Launch standalone SDK Manager and scroll to the bottom.

在此处输入图片说明 在此处输入图片说明

8- Change your build.gradle based on your SDK version and click try again. For example, mine is 23.1.1.

在此处输入图片说明 在此处输入图片说明

If you have any library that is not added automatically please visit https://stackoverflow.com/a/35369267/5475941 to add it manually.I hope it helps.

在此处输入图片说明

Forget the import, just hand build it.

After trying and failing to import the project I did the following hand-import. I gained trust that the export / import procedure didn't leave behind any problems and I gained knowledge of the new build system:

  1. In Android studio create a new blank project
  2. Build it out to device to trust that it is working
  3. Slowly a bit at a time add in your previous code, leaving behind anything specific to the old build system

It is a slow process but the debugging is much more focused on your actual code rather than trying to figure out "what the import actually did".

you may get the answer in this link link

To import an existing Android app project, click Import Project .

Note: If you previously developed your Android project with Eclipse, you should first use the new export feature in the ADT plugin to prepare your project with the new Gradle build system.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM