1
votes

I'm trying to migrate my android projects from Eclipse to Android Studio v1.0.1 in MAC

If I create a new project everything works fine but if I import one of my projects from Eclipse I get the following error:

Error:A problem occurred configuring project ':MyProject'. SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

My local.properties file already has the correct path to the SDK (which I already had installed when I downloaded the ADT bundle for Eclipse)

I also defined ANDROID_HOME environment variable like the answer of this question suggest Setting ANDROID_HOME enviromental variable on Mac OS X

but the error remains. I think there might be something wrong exporting from Eclipse with Gradle or something like that but I really have no clue how to fix it.

Hope anyone can help. Thanks in advance

3
I guess you could always do the annoyingly long way haha. Start a new project and slowly copy and paste code in the hopes that gradle actually updates itself properly. It's a hassle, but if you still haven't found a solution and you really need the project to work on Android Studio, there's always that option as a last resort. Since isn't really a solution to your problem. I'm only posting this as a comment rather than an answer.Mikey

3 Answers

4
votes

you may need to move the settings.gradle file to the project folder
I had the same problem and after changing the file location to the project folder everything goes right.
Hope this helps!

0
votes

I hope you are following the instructions here https://developer.android.com/sdk/installing/migrate.html

0
votes

Check if SDK location is correct 1 - Open Android Studio

2 - Up, Left corner click File->Settings

3 - Look for Appearance & Behavior -> Android SDK

4 - Click Edit, and browse you SDK location (usually is in :Users\\AppData\Local\Android\Sdk) http://i.imgur.com/JIzMebh.png


Check if path on local.properties is correctly setted too.