Tips

Invalidate gradle cache

In android studio, type

cmd+shift+a

Then write

Invalidate caches

Finally click on "Invalidate" then restart.