Home » Android » “Gradle files have changed since last project sync.” message always shows up after change laptop's timezone

“Gradle files have changed since last project sync.” message always shows up after change laptop's timezone

Posted by: admin November 1, 2017 Leave a comment

Questions:

Everything works OK until I change my laptop’s timezone from UTC -8:00 to UTC +7:00. After that, “Gradle files have changed since last project sync…” message always shows up.

How can I fix it? Of course I don’t want to change my timezone to UTC -8:00 again.

Answers:

OK, that’s strange.

Here is what I would do:

  1. Close the project in Android Studio (so you are back at the Welcome dialog), then close Android Studio altogether

  2. Back up the project, so that if the following steps go crazy, I can recover

  3. Delete the build/, .gradle/, and .idea/ directories from the project root, along with the *.iml file in the project root

  4. Delete the build/ directory and the *.iml file from each module in the project (e.g., app/)

  5. Open Android Studio and import the cleaned-up project

This will force a complete regeneration of the .idea/ directory and *.iml files, which are the primary “project files” that the Gradle sync operation is supposed to sync.

Or, just wait 24 hours, as the problem may go away on its own.