Official Android Technical Documentation translation-Eclilpse project migration, androideclilpse
This article is translated From the official Android Technical Documentation Migrating From Eclipse Projects. The original address is http://tools.android.com/tech-docs/new-build-system/migrating-from-eclipse-projects.
This document describes how to migrate an Android project on Ecilpse to Android Studio. You can refer to Eclipse to Android Studio.
It is not easy to translate. For more information, see the source on the CSDN blog:
Http://blog.csdn.net/maosidiaoxian/article/details/42705003
Translation is time-consuming. If you think the translation is still OK, click "TOP" at the end of the article. If any error occurs, please correct me. Thank you.
To migrate an Eclipse project to an Android Studio project, you have two options:
- Directly import the Eclipse project to Studio. This is the preferred method and has many advantages:
- It detects many source code libraries (such as ActionBarSherlock) and binary libraries (such as guava. jar) and replaces these with maven dependencies, which means you no longer need to manually maintain these libraries.
- It will change the project to use the new standard Android Gradle project structure. This new project structure supports the instrumentation test as the test code for testing in the same project, and specific resources of the flavor and build types, etc.
- Export an Eclipse project to a Gradle project in Eclipse. This mechanism is not as flexible (or frequently updated) as the direct Gradle import, but it has two purposes:
- It allows your Gradle project to use the same file structure as the Eclipse ADT project (in other words, it does not move files, everything is in the original location, and then through a special build. the gradle file tells Gradle to find the source code in the old directory structure instead of the new structure ). This will be useful if you want to make the same code library continue to be used in both Studio and Eclipse.
- If your project has many directory mappings specific to Eclipse (such as path variables and resource links), the import of Android Studio may fail to parse the path correctly. In this case, try to export data in Eclipse (but also submit a bug so that we can fix the import ).
To import data directly to Android Studio, select File> import, and select a directory containing your Eclipse ADT project. A wizard will be opened and you will be guided through the rest of the import process. When the project import is complete, the project name "import-summary.txt" is opened, which lists all the steps taken during the import process and provides the next step. For example, it may notice the files that have not been migrated, the components that are missing in your installed SDK, and so on. Export the project in Eclipse from Eclipse, and then start from there,
Export (export)This project.
Note: Make sure that you are using the latest version of Eclipse as much as possible,This is because we have fixed some export-related issues recently.
Select the Gradle option:
Continue with the Wizard. After you finish, you can import the build. gradle file to Android Studio.
After you have completed the basic settings, for more information about how to customize your build, see the user guide for the new build system. For more information, see the overview page of the build system.