首页 > 代码库 > Binary XML file line #2: Error inflating class <unknown>

Binary XML file line #2: Error inflating class <unknown>

E/AndroidRuntime: FATAL EXCEPTION: main

  android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>

at android.view.View.measure(View.java:15848)
   at android.widget.LinearLayout.measureVertical(LinearLayout.java:847)
   at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
at android.view.View.measure(View.java:15848) at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5012) at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)

  这个问题弄了很长时间,各种问也没结果,最终终于查到了一篇比较靠谱的答案

http://blog.csdn.net/huangxiaohu_coder/article/details/8497286

我的问题就是,当前的drawable文件是分级存在的,不是在Android下,而是在project下。在Android下,文件后面会有()里面比如 v21等字眼。

解决办法就是把所有drawable-xxxx文件夹里面的东西都cut到了drawable里面,顺利解决问题

 

不过原因不懂,新建的别的project并没有存在drawable文件夹分级问题``世界未解之谜hhh

Binary XML file line #2: Error inflating class <unknown>