Import Eclipse Project into Android Studio


 

Suppose you are working on a project on eclipse, which have external libraries and jars files inside your project. And you have to switch on Android Studio than it’s not like to eclipse that import all project and libraries than add them directly into project. Android studio use gradle for dependency of libraries and jar file.

Here is a simple example of whole process.

Import Eclipse Project into Android Studio

Here you can see there is three project is present in which RoundShapeActivity is your main project and other two is library project.

Import Eclipse Project into Android Studio

Step1: Right Click on your main project , select “export” than select “Generate Gradle Build Files”.

Import Eclipse Project into Android Studio

Step2: Select project to generate gradle build file.

Import Eclipse Project into Android Studio

Step3: Now finish this process.

Import Eclipse Project into Android Studio

Go to your workspace and check there will be gradle build files are generated.

Import Eclipse Project into Android Studio

Step4: Open your Android Studio and select “import project” . import your root folder of project, where gradle build file are generated.

Import Eclipse Project into Android Studio

Step5: If your version of the Android Gradle plug-in () is not match than fix it or download by clicking on below link on android studio.

Import Eclipse Project into Android Studio

Finally you will get screen like this.

Import Eclipse Project into Android Studio

Step6: Now run your project.

Note: some time gradle give error for supported libraries
In this case open build.gradle of your project and add this line.

dependencies {
compile fileTree(dir: ‘libs’, include: ‘*.jar’, exclude: ‘android-support-*.jar’)
}

Now run your project.

Posted in Android Tutorials | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *

Powered By: wpnova.com