Migrate Eclipse app and libs to Android Studio - android

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.

Related

Unable to add Spotify App Remote SDK library to Android Studio Chipmunk

EDIT: Added link to instructions
https://developer.spotify.com/documentation/android/quick-start/. I am at the section "Add the App Remote SDK".
I am following the step-by-step instructions provided by Spotify to add the App Remote SDK to my Android Studio project.
Their instructions state:
Unzip the App Remote SDK zip file that you downloaded. Add the library to your project by importing it as a module. In the “Project” side bar in Android Studio (View –> Tool Windows –> Project), right click your project’s root folder and navigate to “New” –> “Module”. In the “New Module” window, choose the option “Import .JAR/AAR Package”. Click “Next”.
With Android Studio Chipmunk, this option is no longer available.
I have tried numerous ways of importing the folder "android-sdk-0.7.2.-appremote-v1.2.3-auth" as a library into my Android Project. No matter how I do it, the Gradle Sync succeeds, but my code is not able to resolve any of the com.spotify.android imports. For example:
import com.spotify.android.appremote.api.ConnectionAparams;
Why am I having so much trouble importing a library into AS Chipmunk? I never had problems when using previous versions.
Is anyone else having this issue or just me?
TO fix this problem, I compiled the library into an AAR file. I copied the AAR file to the "libs" folder. Then added it as a module in the Gradle Build. Not sure why this works, but it does...

How to import project files without Gradle files into Android Studio

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

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.

Am I export gradle from eclipse right way?

I want to use Android Studio, but I was working 2 Android Project with Eclipse.
So, I must take libraries and projects from Eclipse(workspace was 'D:\workspace4').
And I export gradle from Eclipse and in AndroidStudio, and go [File > Import Project... ] and select D:\workspace4\build.gradle.
But It seems that I import the Eclipse's workspace for one project.
I tried to export individual project from Eclipse, but I think It's failed.
Always root directory is workspace...
How can I export from My Eclipse's workspace correctly? Please help me...
Migrating from eclipse Projects to android studio includes two options:
1) Exporting from Eclipse :-
step 1:-Update your Eclipse ADT Plugin (you must have version 22.0 or higher).
In Eclipse, select File > Export.
step 2:-In the window that appears, open Android and select Generate Gradle build files.
Step 3:-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.
2)Importing into android studio :-To import into Android Studio, select File > Import, and then select the directory containing your Eclipse ADT project. A wizard will open and guide you through the rest of the import process.
( When the project import has finished, it will open up a file called "import-summary.txt" which lists all the steps taken during import and suggestions for next steps. For example, it may note files that were not migrated,
it may note missing components in your SDK install, and so on.)

Migrating Android apps from Eclipse to Android Studio with multiple user-created libraries and dependencies

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

Categories

Resources