I have seen this same thing posted quite a few times, but whenever I try to import my project to my new work laptop I keep getting this error.
I have pulled the proj
If none of the answers work for you which happened to me on macbook pro in one of the projects you can always try to run Android Studio with an alias command passing sdk.dir with each run:
alias studio='launchctl setenv ANDROID_HOME '\''/Users/username/Library/Android/sdk'\'' && open -a '\''Android Studio'\'''
To fix this problem, I had to define the ANDROID_HOME
environment variable in the Windows OS.
To do this, I went to the System control panel.
I selected "Advanced system settings" in the left column.
On the "Advanced" tab, I selected "Environment Variables" at the bottom.
Here, I did not have an ANDROID_HOME
variable defined. For this case, I selected "New..." and:
1) for "Variable name" I typed ANDROID_HOME
,
2) for "Variable value", I typed the path to my SDK folder, e.g. "C:\...\AppData\Local\Android\sdk"
.
I then closed Android Studio and reopened, and everything worked.
Thanks to Dibish (https://stackoverflow.com/users/2244411/dibish) for one of his posts that gave me this idea.
You have also to ensure you have the correct SDK platform version installed in your environment by using SDK Manager.
Copy and paste the local.properties file from a project you created on your new computer to the folder containing the project from your old computer also works too if you don't want to (or know how to) create a new local.properties file.
Had the same problem in IntelliJ 12, even though I have ANDROID_HOME env variable it still gives the same error. I ended up creating local.properties file under the root of my project (my project has a main project w/ a few submodules in its own directories). This solved the error.
I clone libgdx
demo, can't import project. it also reminds like this.
Env:
Eclipse(Android-ADT)
window 7
so I create local.properties file at the project root, like following
sdk.dir = D:/adt-bundle-windows-x86/sdk
I hope this can help others!