Binary XML file line #2: Error inflating

简介:
  1. 06-27 14:29:27.600: E/AndroidRuntime(6936): FATAL EXCEPTION: main  
  2. 06-27 14:29:27.600: E/AndroidRuntime(6936): android.view.InflateException: Binary XML file line #2: Error inflating class   
  3.   
  4. com.example.FileListItem  
  5. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:691)  
  6. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.LayoutInflater.inflate(LayoutInflater.java:466)  
  7. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.LayoutInflater.inflate(LayoutInflater.java:396)  
  8. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at com.example.filemanage.FileListAdapter.getView(FileListAdapter.java:51)  
  9. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.AbsListView.obtainView(AbsListView.java:2033)  
  10. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.ListView.measureHeightOfChildren(ListView.java:1244)  
  11. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.ListView.onMeasure(ListView.java:1155)  
  12. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.View.measure(View.java:12723)  
  13. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)  
  14. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)  
  15. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.View.measure(View.java:12723)  
  16. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:812)  
  17. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)  
  18. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.View.measure(View.java:12723)  
  19. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)  
  20. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)  
  21. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.View.measure(View.java:12723)  
  22. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.LinearLayout.measureVertical(LinearLayout.java:812)  
  23. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.LinearLayout.onMeasure(LinearLayout.java:553)  
  24. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.View.measure(View.java:12723)  
  25. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:4698)  
  26. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.widget.FrameLayout.onMeasure(FrameLayout.java:293)  
  27. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2095)  
  28. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.View.measure(View.java:12723)  
  29. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1064)  
  30. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.ViewRootImpl.handleMessage(ViewRootImpl.java:2442)  
  31. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.os.Handler.dispatchMessage(Handler.java:99)  
  32. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.os.Looper.loop(Looper.java:137)  
  33. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.app.ActivityThread.main(ActivityThread.java:4456)  
  34. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at java.lang.reflect.Method.invokeNative(Native Method)  
  35. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at java.lang.reflect.Method.invoke(Method.java:511)  
  36. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:787)  
  37. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:554)  
  38. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at dalvik.system.NativeStart.main(Native Method)  
  39. 06-27 14:29:27.600: E/AndroidRuntime(6936): Caused by: java.lang.ClassNotFoundException: com.example.FileListItem  
  40. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)  
  41. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at java.lang.ClassLoader.loadClass(ClassLoader.java:501)  
  42. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at java.lang.ClassLoader.loadClass(ClassLoader.java:461)  
  43. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.LayoutInflater.createView(LayoutInflater.java:552)  
  44. 06-27 14:29:27.600: E/AndroidRuntime(6936):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)  
  45. 06-27 14:29:27.600: E/AndroidRuntime(6936):     ... 33 more  


如果报这个错误有可能是布局文件中有自定义View    记得修改自定义布局包名


像我这边就包名写错了,一直报错,com.example.filemanage包下找不到FileListItem这个类

<com.example.filemanage.FileListItem    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingTop="5dip"
    android:paddingBottom="5dip"
    android:orientation="horizontal"
    android:gravity="center_vertical">

目录
相关文章
|
10天前
|
存储 网络安全
Curl error (60): SSL peer certificate or SSH remote key was not OK for https://update.cs2c.com.cn/NS/V10/V10SP2/os/adv/lic/base/x86_64/repodata/repomd.xml [SSL: no alternative certificate subject name matches target host name 'update.cs2c.com.cn']
【10月更文挑战第30天】在尝试从麒麟软件仓库(ks10-adv-os)下载元数据时,遇到 SSL 证书验证问题。错误提示为:`Curl error (60): SSL peer certificate or SSH remote key was not OK`。可能原因包括证书不被信任、证书与域名不匹配或网络问题。解决方法包括检查网络连接、导入 SSL 证书、禁用 SSL 证书验证(不推荐)、联系仓库管理员、检查系统时间和尝试其他镜像。
31 1
|
XML JSON 人工智能
Error while extracting response for type [class xxx] and content type application/xml;charset=UTF-8
Error while extracting response for type [class xxx] and content type application/xml;charset=UTF-8
1135 0
|
4月前
|
XML 数据格式 Python
【Python】已解决:xml.parsers.expat.ExpatError: no element found: Line 1, column 0
【Python】已解决:xml.parsers.expat.ExpatError: no element found: Line 1, column 0
102 0
|
4月前
|
XML 数据格式 Python
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘./1.xml’
【Python】已解决:FileNotFoundError: [Errno 2] No such file or directory: ‘./1.xml’
151 0
|
6月前
|
openCL 开发工具 异构计算
mtk make:*** [xml_parser] Error 255
mtk make:*** [xml_parser] Error 255
38 0
|
6月前
|
XML Android开发 数据格式
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class
Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class
56 0
|
6月前
|
XML 数据格式
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
android.view.InflateException: Binary XML file line #0: Attempt to invoke virtual
31 0
|
6月前
|
XML Android开发 数据格式
Error obtaining Ul hierarchy Reason_ Error while obtaining Ul hierarchy XML file
Error obtaining Ul hierarchy Reason_ Error while obtaining Ul hierarchy XML file
78 0
|
XML Android开发 数据格式
Android Binary XML file line #50: Error inflating class androidx.cardview.widget.CardView 错误
Android Binary XML file line #50: Error inflating class androidx.cardview.widget.CardView 错误
85 0
|
1月前
|
XML 前端开发 Java
讲解SSM的xml文件
本文详细介绍了SSM框架中的xml配置文件,包括springMVC.xml和applicationContext.xml,涉及组件扫描、数据源配置、事务管理、MyBatis集成以及Spring MVC的视图解析器配置。
55 1