Unknown attribute android:layout_width, layout_height, id, gravity, layout_gravity, padding
Just go to Tools->Android->Sync Project with Gradle Files
The only thing that worked for me was cleaning the following folders:
c:\Users\<user>\.gradle\caches\c:\Users\<user>\.AndroidStudio3.2\system\caches\
Android Studio will just redownload the libraries and caches them which will enable everything back to normal.
Source: https://stackoverflow.com/a/53053438/7515903
Credits: @alexuz
To fix, change something in your gradle file, then sync gradle again. This worked for me.