Android Studio 0.4.2: Gradle Project Sync Failed Error

android studio 0.4.2: Gradle project sync failed error

I'm assuming I can answer my own question....
This worked for me.

  1. File -> Invalidate caches / Restart
  2. Shutdown Android Studio
  3. Rename/remove .gradle folder in the user home directory
  4. Restart Android Studio let it download all the Gradle stuff it needs
  5. Gradle build success !
  6. Rebuild project.... success !

Out of curiousity I compared the structure of the old .gradle and the new one... they were pretty different !

So I'll see how 0.4.2 goes :)

Gradle project sync failed (Android Studio)

Found the solution: just click Tools > Android > Sync Project with Gradle Files (did it in every branch). Everything is fine now. Thanks to this article: http://devdeeds.com/update-gradle-plugin-android-studio/

How to fix sudden and generic Gradle Project Sync Failed error

I solved my own problem in a pretty simple way. I created a new project, opened the app-level build.gradle file, added all the extra dependencies from the old project, then replaced the old file with the newly created one. This solved the issue. Upon inspecting the differences between old and new I realized that somehow

android {
buildToolsVersion '29.x.x'
}

had been added to the old project and it was one version greater than the compileSdkVersion. After Gradle finally synced successfully it notified me to fix the buildToolsVersion, which is now the same as the compileSdkVersion.

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
}


Related Topics



Leave a reply



Submit