简体   繁体   中英

Android Studio import Eclipse project

Android Studio 0.4.0

I tried to import eclipse project directly (not exported eclipse project as "generate gradle build files") and tried this migrating soliution . The result of both ways is like this: 在此输入图像描述

Is this good project structure? And if it is not how to migrate Eclipse project to Android Studio?

Andriod Studio import log

Google repository is installed

在此输入图像描述

PS Some Android associated buttons in toolbar are inactive after project import.

在此输入图像描述

Looking at your log file, I see this:

com.intellij.openapi.externalSystem.model.ExternalSystemException: Could not find any version that matches com.google.android.gms:play-services:+.
Required by:
    kmvts-rb-1.1.0:app:unspecified

which means that it can't find the Play Services repository. In your (click on the button in the Android Studio toolbar; that will ensure you open the SDK Manager for the copy it's using to build your project), install the . (单击Android Studio工具栏中的按钮;这将确保您打开SDK Manager以用于构建项目的副本),安装Now you should be able to import your project.

We're working on having much better handling of this situation in the future, but for now you have to know to install it yourself.

I found that the easiest way to import from Eclipse to Android Studio, is to use File -> Import project , select the project to import from your file structure then use create project from existing sources and select Eclipse.

If you are used to the Eclipse key bindings, Android Studio/Intellij IDEA will also let you change your keyboard binding configurations to the default eclipse ones. To do this, use Settings -> IDE Settings -> keymap and select Eclipse from the drop down menu at the top.

No, that is not a good project structure. After you have generated gradle build files , make sure the project can built properly from command line using gradle. To build a project run gradlew.bat or gradlew from project root. You may encounter one or more errors, I've posted fixes for some commonly encountered errors here . After fixing all errors try importing to Android Studio again.

This link maybe helpful :

How do you import an Eclipse project into Android Studio

  • The root directory of the project you import must have an AndroidManifest.xml file.
  • Either: The root directory must contain the .project and .classpath files from Eclipse or The root directoy must contain res and src directories.

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