Unknown attribute android:layout_width, layout_height, id, gravity, layout_gravity, padding Unknown attribute android:layout_width, layout_height, id, gravity, layout_gravity, padding android android

Unknown attribute android:layout_width, layout_height, id, gravity, layout_gravity, padding


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.

Credit: https://stackoverflow.com/a/47500156/5673746