Error inflating class android.support.design.widget.FloatingActionButton

后端 未结 12 1739
清歌不尽
清歌不尽 2021-02-05 01:24

My app crashed because

Error inflating class android.support.design.widget.FloatingActionButton

This is my code in the XML



        
12条回答
  •  再見小時候
    2021-02-05 01:44

    I was using Material Design for my ExtendedFloatingActionButton and when using API 24 it would crash the app.

    I tried updating my gradle dependencies to the latest version:

    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'com.google.android.material:material:1.3.0-alpha02'
    

    but I had no luck with that either. My solution was adding android:theme="" even though I had set a style it would still crash so I set the theme to the same as the style and it worked perfectly.

    
    

提交回复
热议问题