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.
Asked
Active
Viewed 2,856 times
2
-
Did you [try this ?](http://stackoverflow.com/a/21996772/2591002) Try *deleting gradle and .gradle folders from your project folder* – SweetWisher ツ Jan 01 '15 at 10:33
-
Ya i followed all steps is in link @SweetWisher – Sushant Jamdade Jan 01 '15 at 10:37
-
It gives error like failed to find target android -20 – Sushant Jamdade Jan 01 '15 at 10:38
-
what is your min SDK ? – SweetWisher ツ Jan 01 '15 at 10:38
-
in eclipse i set it to 11 but in android studio i unable to find. I'm importing project to android studio. – Sushant Jamdade Jan 01 '15 at 10:41
-
Check [build.gradle (module:app)](http://i.gyazo.com/2b7b9c83a9bec2ab1812fcd43833b935.png) – SweetWisher ツ Jan 01 '15 at 10:42
-
after importing it says:- 'Gradle project sync failed. Basic functionality (e.g editing, debugging) will not work properly ' – Sushant Jamdade Jan 01 '15 at 10:43
-
Check [classpath in build.gradle of your project](http://stackoverflow.com/a/27517208/2591002) – SweetWisher ツ Jan 01 '15 at 10:45
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/68024/discussion-between-sweetwisher--and-sushant-jamdade). – SweetWisher ツ Jan 01 '15 at 10:46
-
wait 5 min i ll check it out @ SweetWisher – Sushant Jamdade Jan 01 '15 at 10:46
2 Answers
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