Error running MyActivity: Gradle project sync failed. Please fix your project and try again
android, android-gradle-plugin, android-studio, gradle
Solution
- Goto File -> Invalidate caches / Restart
- Shutdown Android Studio
- Rename/remove .gradle folder in the user home directory
- Restart Android Studio (It will download gradle metadata and data)
- Gradle build succeed
- Rebuild project
- Done
Problem
I am new to Android Studio and I have just created a new project with only one Activity with fragments(Android studio created that), and when I ran the MyActivity.java , error occurs: ``` Error running MyActivity: Gradle project sync failed. Please fix your project and try again. ``` Nothing more in my event log. I have no idea why it is, and This link did not helps. One clue is that Gradle project sync in progress is flowing all the time , just after I restart the Studio.