Credit to @Grsmto
As per this blog post you need to open a terminal and launch the following commands sequentially:
UPDATE
Now the workaround it’s easier, you just need to go to Build -> Clean Project and then sync.
Windows
gradlew clean
gradlew assemble
Linux/Mac
./gradlew clean
./gradlew assemble
then sync the project.