Android Studio 2.2.2 Importing projects created in Eclipse

Source: Internet
Author: User

Recently with video tutorials to learn Android, originally used ADT to write Android programs, Midway Tutorial replaced with Android studio, so I myself under the Android Studio 2.2.2 installed, and download the SDK, and then replace the development environment.

However, the tutorial does not explain how to import the old Eclipse project into Android Studio (hereinafter referred to as).

Spent the whole day on the Internet to find relevant articles, found that can not completely solve the problem, probably because the new version of as related articles less. So in the cost of a good step by step to try to import, the initial fix, record the import encountered problems and solutions.

The As launcher interface has the Android Studio-import project (Eclipse ADT, Gradle, etc) option, which is used to import the Eclipse project, which is the new Android Gradle Project Import method.

However, you cannot directly import projects that are written by eclipse, which results in an error when the import is completed.

Could not the Find Method Android () for arguments [[e-mail protected]] on root project ' xxxxxx ' of type Org.gradle.api.Project.

Looked for a long time, also did not find the solution, even mentioned this error article is very few.

Instead, use the second approach, which is compatible with how eclipse is imported.

  1. In Eclipse, select Android-generate-gradle build files, select the project you want to export, and then click Finish to finish. Note: To save the Eclipse Project copy in advance, otherwise this export can not specify the target path, directly in the original project generated the Build.gradle file, I do not know if there will be any trouble.
  2. Open as, select Import Project (Eclipse ADT, Gradle, etc) from the launch screen, and then select the Build.gradle file that is generated in the Eclipse project.
  3. After the import is completed, because the original project target Android platform is lower, just Android-18, my as SDK does not download android-18, prompts me to download, I in the Project right button-Open Module Settings, select My Module ( Is that the imported project,project is a project in Eclipse, a workspace in as, and changes the compile SDK version and build Vools version under the properties of the right area to the version I have downloaded, I am here API 21:android 5.0 and 21.1.2.
  4. As in the Run button is gray, to click on the menu Run-edit configration choose the Android App under the name of their own project, in the right area to choose the module, Deploy, Launch, these several a look will understand, no longer repeat.
  5. At this point the Run button turns green, click Run, Error: Some file crunching failed, this is because some. 9 figure is not standard cause.

    Modify the Build.gradle file under the main project folder and add the following two lines to Android {}

    Android {         false false ...}    

  6. Also reported crunching Cruncher Xxxx.9.png failed error, simply put the error of these several. 9 figure is replaced by the normal PNG image, the error. 9 Figure Delete all
  7. Finally: Build-clean Project, the error message disappears. Run, the app is successfully installed and running on the emulator. At this point, the project is imported successfully and can run in as.

Android Studio 2.2.2 Importing projects created in Eclipse

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.