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

前端 未结 4 2002
时光说笑
时光说笑 2020-12-31 06:32

I have bellow xml:




        
4条回答
  •  青春惊慌失措
    2020-12-31 07:00

    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'
    

提交回复
热议问题