I am new user of Android Studio and I have serious problem with trying to import Android Studio project to Android Studio on other PC. In general, my Gradle doesn't want to build the project and it is caused by problem with path.
Error log:
Failed to import Gradle project: Could not fetch model of type 'IdeaProject' using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.
Build file 'E:\Projects\MenuMenu\EventGame\build.gradle' line: 1
A problem occurred evaluating project ':EventGame'.
A problem occurred evaluating project ':EventGame'.
The SDK directory 'E:\Program Files (x86)\Android\android-studio\bin' does not exist
My Android-Studio SDK is in directory:
E:\Program Files (x86)\Android\android-studio\sdk
I found from various posts with similar problems that you can change path to sdk in local.properties file. Mine looks currently like that:
sdk.dir=
So it's empty, but still default path is SOMEHOW set to "E:\Program Files (x86)\Android\android-studio\bin" and I have no idea how to change it. If i try to add to sdk.dir real path the error is the same but the path in error looks like that.
The SDK directory 'E:\Program Files (x86)\Android\android-studio\bin"E:\Program Files (x86)\Android\android-studio\sdk"' does not exist
In 90% of causes I could find via the net people were solving the problem by adding: sdk.dir=/Applications/Android Studio.app/sdk
But then directory is set to E:\Program Files (x86)\Android\android-studio\bin\Applications\Android Studio.app\sdk and something like that doesn't exist in my PC.
Do you have any idea how to solve this problem. Is there any way to change this default path? I also get error:
E:\Projects\MenuMenu\EventGame\build.gradle
Gradle: A problem occurred evaluating project ':EventGame'.
> The SDK directory 'E:\Program Files (x86)\Android\android-studio\system\compile-server' does not exist.
Thats how my folders looks like: https://www.dropbox.com/s/ikj63gmyfax8z4u/folders.png
The easiest and imho the cleanest way to do this is not to set the directory by code, but with an enviroment variable in Windows:
If you have a command line window open then close this as well and reopen cmd.exe if you want to use ANDROID_HOME within the command line.
Okay in general problem was caused by the fact that the project was imported from Android-Studio installed on Mac. The slashes were in oposite direction, and somehow program couldn't override default direction because he couldn't understand the path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With