InflateException: Binary XML file line #1: Error inflating class caused by OutOfMemoryError

前端 未结 10 1749
梦如初夏
梦如初夏 2020-11-27 05:59

Here is my code:

input.xml (layout folder)



        
10条回答
  •  时光说笑
    2020-11-27 06:35

    for those who have this problem: there are some cases that may lead app to crash. I have seen these the most.

    1- using ?selectableItemBackground may cause this problem.

    2- if using large images (or else) that make the application errors like failed to allocate... this happens when hardware accelerated is on. you can set it to off in this case and using large-heap in manifest(application element)

    3- if you have a drawable that is in v-21(for example) branch and you are running app on below 21, it can cause this problem too.

    good luck!

提交回复
热议问题