How to import project files without Gradle files into Android Studio - android

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

Related

Migrate Eclipse app and libs to Android Studio

I have an Android app project in eclipse that references to 3 libs+ some jar files and I would like to migrate all to Android studio.
First, I export "generate Gradle build files" (app) and succeed import in Android Studio.
I tried to create root folder manualy but the Imports in the App "cannot resolve symbol .."
How do I migrate the rest libs and jars and implement them?
If you want to move the rest of your libs and jars to Android studio, you can do it in three different ways. Please read this link https://stackoverflow.com/a/35369267/5475941. In this post I explained how to import your JAR files in Android studio and I explained all possible ways step by step with screenshots. I hope it helps.
No need to export your project in android studio manage itself ,
open android studio and select import project (eclipse adt etc)
browse to your project root directory and pick your main project not
library or dependent project .
start wizard to import and wait to complete gradle build.

Importing and converting Eclipse-made Android project from Github to Android Studio Gradle-build

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.

"Gradle location is incorrect" when migrating android project from eclipse to android studio

I followed the this guide to migrate my android project
https://developer.android.com/sdk/installing/migrate.html
I have exported a Gradle file through eclipse. When I try to import the project to android studio, I am stucked with this error. Please help
Android studio version 0.6.1
That's not asking for your project's Gradle structured files it wants the location of your Gradle Build tools or Gradle configuration file.
It defaults as a file called .gradle in your user home directory I think.
Mine points to:
/home/indiv/.gradle
Although, I found it easier to import my Eclipse projects into Studio (as Eclipse projects) than export a Gradle project from Eclipse and then import to Studio.
Your choice though.

Convert a project to Android Studio

I'm trying to open the following project https://github.com/mik3y/usb-serial-for-android on Android Studio but all the things I try it give me errors related to gradle :s
It says version 0.9.0 introduce some incompatible changes but then I can't make the changes they said.
Can anyone try it to me?
The biggest issue is that Android Studio uses Gradle and Eclipse does not. It sounds like the GitHub project was built with Eclipse, which means you first have to import that project into Eclipse, then export it with the Gradle files.
From the Android docs
Export from Eclipse
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.
Your selected project remains in the same location but now contains a build.gradle file and is ready for Android Studio.
Import into 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.) Now that your project is imported to
Android Studio, read Tips and Tricks for some help getting started.
Note: It's possible to import an existing Android project to Android
Studio even if you don't generate a Gradle build file from
Eclipse—Android Studio will successfully build and run projects using
an existing Ant build file. However, in order to take advantage of
build variants and other advanced features in the future, we strongly
suggest that you generate a Gradle build file using the ADT plugin or
write your own Gradle build file for use with Android Studio. For more
information about the Gradle build system, see the Gradle Plugin User
Guide.

Android Studio: Importing project into existing project

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.

Categories

Resources