Binary XML file line #0: Error inflating class

前端 未结 2 1039
粉色の甜心
粉色の甜心 2020-12-11 16:33

I have error running a quiz game. Something like this (when open gameactivity). My application stop and I ge Binary XML file error on line #0. It`s kinda weird, becouse I di

相关标签:
2条回答
  • 2020-12-11 17:03

    Try to remove cornerRadius property it's causes the problem may be it's library issues

    fbutton:cornerRadius="10dp"
    

    Remove it's all buttons and it's work well

    0 讨论(0)
  • 2020-12-11 17:10

    The problem comes with the library itself, If you check attrs.xml:

    <attr name="buttonColor" format="color" />
    

    As you can see the buttonColor only accepts color value, NOT color reference, and the view is trying to convert reference value you pass in xml to color and it throws an exception, So you can only use color for this attribute ( like this: #000000) Or fork the project and modify attrs.xml like this:

    <attr name="buttonColor" format="color|reference" />
    
    0 讨论(0)
提交回复
热议问题