2

I'm an android developer. Now I switched to Android Studio. While importing Android Eclipse project to Android Studio it gives an error like Failed to sync Gradle project 'Project Name'. I tried a lot to solve this error, even I changed Gradle path too. But still an error remains.

2 Answers2

1

failed to find target android -20

It seems that you haven't installed API 20 in your SDK manager. First check it and download if it's missing.

Then try adding this line distributionUrl /gradle-2.2.1-all.zip to gradle-1.10-all.zip in gradle/wrapper/gradle-wrapper.properties like :

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip

Lastly, run Android Studio as Admin and clean the project :)

Hope it helps ツ

SweetWisher ツ
  • 7,296
  • 2
  • 30
  • 74
0

Go to Gradle Tasks (tab on left), or type commands in terminal:

Run Clean and Build from Gradle Tasks, or you type in terminal: "gradlew clean" and "gradlew build" (without "").

Then go to Messages (there's tab down), and look what errors are reported. Try to solve it, or ask for help here.

Edit: To add, very likely problem with dependecies when importing eclipse project.

JoKr
  • 4,976
  • 8
  • 27
  • 39