Android Studio waiting for build to finish

What worked for me was, from the top menu:

Build -> Clean
Build -> Rebuild Project

After that the xml design worked


You can do the following:

"File > Sync Project with Gradle files" (worked for me)

File > Invalidate Cache & Restart > Just Restart

OR

File > Invalidate Cache & Restart > Invalidate & Restart

Close Project and Re-Import the Project


File -> Sync project with Gradle files


I've just run into the exact same problem. I simply solved it by choosing Sync Project with Gradle Files. This will trigger a Gradle re-import and a build.

As of Android Studio v3.2, the icon is located near the top right tool bar. You can also find it using Find Action shortcut CtrlShiftA.