I've got a Eclipse project which I somehow managed to get working in Android Studio awhile back. It uses TouchDB library/project which I now want to upgrade to their latest offering couchbase-lite-android which looks like it comes ready built for Android Studio with gradle files.
However I'm at a loss how to go ahead and import this project into my existing one. File -> Import Project gives me 3 options, create project from existing sources, import from external model (mavern), import from external model (gradle)
If I choose gradle it builds couchdbase-lite-android then opens it into it's own Android Studio window, it definitely doesn't get imported into my current project.
Any ideas...
Try going to File -> "Import Module" instead of "Import Project". In Android Studio, an entire window is a project. Each top-level item in that project is called a module. Coming from the Eclipse world, it'd be:
Eclipse workspace = Android Studio project
Eclipse project = Android Studio module
As for Android Studio ver. 2.1.2 (which I have now) it should be File - New - Import Module... and then choose the path to the project folder to be imported.
Related
I want to import a project into my Android Studio. It works well in Eclipse when my friend gave it to me.
But I couldn't import it into my Android Studio. And all the tutorial told me that I should add/edit the Gradle files when there is no Gradle files in this project. So what am I going to do without having to download the Eclipse IDE? Many thanks.
You can export the project from eclipse to a gradle project.
Right clicks your project.
Clicks the 'export' in the popup menu.
Choose Android > Generate gradle build files. (If there is not 'Generate gradle build files', maybe you need to install gradle plugin for eclipse: here)
And then you can import this project on android studio.
Other people have said it here in the comments, the answer is inside Android Studio: File -> new -> import project
I made some apps in the past with android studio, and there was no problems with them.
And I could open example projects from many sites, for example: developer.android.com/.
Now after an update of android studio, I can't open projects in android studio without migrating them manually, which was done before the update by android studio itself.
What could be the problem now?
First I get this warning, that android framework is detected.
Then after choosing the setup frameworks and clicking ok, I get this:
As you can see it is not gradle based project.
What can I do to make android studio automatically migrate projects again?
IMPORTING ANDROID STUDIO PROJECT IN ANDROID STUDIO:
If you want to import An Android Studio Project then do the following:
1.
Select Open an existing Android Studio Project
2. Browse your desired project derectory.
3. Now rather than selecting the folder that contains your project, you have to select the build.gradle file that is just inside of your parent folder of the project.
It will not create any problem and will not ask you to migrate into gradle and import any framework at all.
IMPORTING ECLIPSE PROJECT IN ANDROID STUDIO:
If you want to import Eclipse Project in Android Studio:
1. Select Import project (Eclipse ADT, Gradle, etc.)
2. Then nothing special just follow the instructions in the wizard.
I'm trying to migrate from using Eclipse for my Android-project to the new Android Studio, and I'm having an issue related to Gradle.
What I want is for me to push the latest Eclipse-build to Github, and then be able to pull it down in Android Studio, having the latter automatically convert the project to a Gradle-build. If I'm reading the documentation right, the Android Studio import is supposedly able to do this.
When importing, I can choose between "Create project from exisiting sources" or "Import project from external model"
If I choose the first option, the project won't use Gradle (as far as I can see). If I choose the second, it seems to be looking for an already existing gradle buildfile "build.gradle" in my project.
So - Should I download a Gradle-plugin to Eclipse and make a gradle build-file there, or am I doing something wrong in the import?
It seems the only other questions I can find on SO is about importing and Eclipse export or simply how to pull a project from Github in Android Studio.
Thanks :-)
Importing and converting an existing Eclipse project into a Android Studio Gradle project is quite simple :
File -> Import Project (in Android Studio)
Select the manifest of your Eclipse Android project.
Done.
There may be some dependacy management to deal with.
You can also take a look here :
How do you import an Eclipse project into Android Studio now?
How about this:
clone repo to location 1
export from eclipse
import to android studio in location 2
copy the .hg files or whatever's applicable from 1 to 2
commit from location 2 including deleting eclipse files
Now the repo will have the android studio project and not eclipse.
I followed the directions in this link Migration from Eclipse to Android Studio
then I able to import the build.gradle to Android Studio. But I cannot run the project, there are also no Android Manifest, Activities, and layouts in the imported project.
My project works fine in Eclipse, and it includes modules.
How to run the imported android project from exported eclipse.
Export from Eclipes:
Update your Eclipse ADT Plugin (you must have version 22.0 or higher).
In Eclipse, select File > Export.
In the window that appears, open Android and select Generate Gradle build files.
Select the project you want to export for Android Studio and click Finish.
Import in Android Studio
In Android Studio, close any projects currently open. You should see the Welcome to Android Studio window.
Click Import Project.
Locate the project you exported from Eclipse, expand it, select the build.gradle file and click OK.
In the following dialog, leave Use gradle wrapper selected and click OK. (You do not need to specify the Gradle home.)
Source
How can you migrate to Android Studio using an Eclipse project depending one many user libraries?
I've tried using the Eclipse export to gradle but I can't seem to get it to work.
Also, my project sources are not in the workspace.
As of Android Studio 0.4.2, you can now import the Eclipse project from Android Studio.
Note: This is different from Eclipse's export Gradle project function.
Open Android Studio
Verify the version is >0.4.2, if not update to it. (I had to download it from the tools website)
Import Project...
Navigate to the actual Android app project, the highest level project (not the workspace or the directory containing all the eclipse projects)
Follow the wizard to import it all
The advantages of doing it this was is that :
makes the migration less painful
generates gradle files
restructures your project as a gradle/Android Studio project