Error inflating class com.google.android.material.appbar.AppBarLayout

Don't forget to use Theme.MaterialComponents.Light.NoActionBar (or any Theme.MaterialComponents.*.NoActionBar really) as your parent AppTheme in style.xml (source).


You're using AndroidX tags-components which you already have AppCompat dependencies. This will cause other issues too. Go with the Refactor -> Migrate to AndoridX and add the mentioned dependency for the material components too.

In your build.gradle dependencies:

implementation 'com.google.android.material:material:1.0.0'

It's coming from Material components -> com.google.android.material as you can see so, that's why you get the error.

Remember to update the gradle in the other build.gradle too:

classpath 'com.android.tools.build:gradle:3.2.0'

implementation 'com.google.android.material:material:1.0.0'
classpath 'com.android.tools.build:gradle:3.2.0'

If you have added the above two conditions and it's still showing the error you can try a "LinearLayout" instead.