2

I Copied my Android Studio project from my work PC and copied it to my home PC. When I opened the project I got the following error:

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 'C:\Users\Tom\AndroidStudioProjects\CongressProject\Congress\build.gradle' line: 9 A problem occurred evaluating project ':Congress'. A problem occurred evaluating project ':Congress'. The SDK directory 'D:\Program Files\Android\android-studio\sdk' does not exist.

I guess that's because all my SDK\JDK and all other settings are in different locations in my work PC and home PC. I get this error all the time I try to rebuild my project.

How do I fix this so I can work on the same project from home and work? I want to make it easy to copy the project from my 2 different PC's.

thanks!

TomG
  • 2,409
  • 4
  • 23
  • 40
  • Can you create the folder on disk D:\ like on your work computer? However, i also found two similar issues on SO: http://stackoverflow.com/questions/17125175/gradle-build-errors-after-updating-android-studio and http://stackoverflow.com/questions/17678289/android-studio-gradle-build-error-cant-locate-sdk-and-compile-server. I guess they'll work. – g00dy Sep 05 '13 at 15:48

2 Answers2

7

I found a similar question in: Gradle build errors after updating Android Studio

in the local.properties file in the root of the project, change the sdk.dir value.

Community
  • 1
  • 1
TomG
  • 2,409
  • 4
  • 23
  • 40
0

For anyone else running into Gradle issues after updating Android Studio:

Go to File > Project Structure > Project.

My Gradle version and Android plug in version did not match, which was causing my issue. If you make a change here, make sure you also update your top-level Gradle file with the same version like so: classpath 'com.android.tools.build:gradle:some version number'

sav621
  • 21
  • 5