Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Import project in Android Studio from Eclipse

I installed new Android Studio 0.1.1 based on IDEA ide and tried Import code from Eclipse.

  1. Go to Eclipse->Export->Grandle so it add gradle file
  2. Open Android Studio and select Import Project and select my project folder with build.gradle file
  3. Press Finish and get an Error: failed to find target android-15 (this is was parget of my project) enter image description here
  4. I go to system variables and change to %ANDROID_HOME% = d:\dev\android\android-studio\sdk\ (remove platform-tools from path)
  5. And get new error: failed to find Build Tools revision 15.0.0 enter image description here
  6. Also create another New Project and change Android SDK for it, but I still cant import project

I explore this problem and find the weak point: in file build.gradle I change next lines:

  • from compileSdkVersion 15 to compileSdkVersion "17"
  • from buildToolsVersion "15" to buildToolsVersion "17"

And it fix my problem with project import. I think it's problem in Eclipse export function. Build tools starts only from version 17 (in ADT 22), so it's imposible to find version 15.

like image 995
Borys Avatar asked May 16 '13 20:05

Borys


People also ask

How do I import a project into Android Studio?

Go to File->New->Import Module then browse you project. After importing module go to project structure and add module dependency to your project.

How do I import library to android?

To use your Android library's code in another app module, proceed as follows: Navigate to File > Project Structure > Dependencies. In the Declared Dependencies tab, click and select Library Dependency in the dropdown. In the Add Library Dependency dialog, use the search box to find the library to add.


1 Answers

Had same problem, now works. I did this:

Open android studio:

Tools -> android -> SDK manager then install the android 4.0.3 (API 15) and done.

It worked for me.

like image 177
inigoD Avatar answered Oct 01 '22 03:10

inigoD