4

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: enter image description here

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

enter image description here

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

enter image description here

Robertas Setkus
  • 3,075
  • 6
  • 31
  • 54
  • The best way to import is going to be to use the Import Project command in the File menu. Having said that, this support for import of Eclipse projects is brand new and still has some bugs to be worked out. If your project uses NDK, there are known issues that will be fixed in 0.4.3. If it's not that, then some other bug must have messed up your project import. Is there anything useful in your idea.log file (Help menu > Show Log) after trying the import? – Scott Barta Jan 03 '14 at 16:36
  • No. My application is not using NDK but uses external libs like robospice, google play service, androidcompat actionbar. (Added log output. Post was edited.) – Robertas Setkus Jan 06 '14 at 07:23
  • No this not the correct project structure there some error in gradle sync so you are not getting the actual project.Try to sync your project with gradle again and check whether it is throwing any error. If it is please post that. Some time closing and opening the project again solved my problem. – Piyush Agarwal Jan 06 '14 at 19:46
  • From bellow link you can get helpful information: [How do you import an Eclipse project into Android Studio][1] [1]: http://stackoverflow.com/questions/22791150/how-do-you-import-an-eclipse-project-into-android-studio-now – Fred Dec 30 '14 at 17:32

4 Answers4

1

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 SDK Manager (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 Google Repository. 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.

Scott Barta
  • 79,344
  • 24
  • 180
  • 163
  • 1
    Goole play services and repository is installed. I'm not familiar with gradle and I can't find out why studio cant't find google services repo. So I think that I just have to wait for new realeses where these bugs will be solved. For now I feel good at eclipse based IDE. – Robertas Setkus Jan 07 '14 at 07:29
0

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.

JamoBox
  • 764
  • 9
  • 23
  • It would be great if would be any options like `create project from existing sources`. Maybe you'r using different Studio version than mine. – Robertas Setkus Jan 03 '14 at 13:44
  • Ah, my bad then. I use Intellij IDEA Community Edition, I figured it would be the same for Android Studio as the studio was built on top of Intellij IDEA to extend functionality. – JamoBox Jan 03 '14 at 15:51
  • @JamoBox ya you are correct but AS is totally Android Focused IDE and AFAIK one can't create and import simple java project in Android Studio. Things are different from Intellij IDEA Community Edition . – Piyush Agarwal Jan 06 '14 at 20:01
0

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.

Community
  • 1
  • 1
Binoy Babu
  • 16,699
  • 17
  • 91
  • 134
0

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.
Community
  • 1
  • 1
Fred
  • 3,365
  • 4
  • 36
  • 57