首页 > 代码库 > android.view.InflateException: Binary XML file 解决方案
android.view.InflateException: Binary XML file 解决方案
android.view.InflateException: Binary XML file line #2: Error inflating class 的解决方法
java.lang.RuntimeException: Unable to start activity ComponentInfo{cn.xs8.app/cn.xs8.app.activity.news.Xs8_News_SplashActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2200) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2262) at android.app.ActivityThread.access$600(ActivityThread.java:148) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1241) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5145) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:802) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:569) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class at android.view.LayoutInflater.createView(LayoutInflater.java:613) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at android.view.LayoutInflater.inflate(LayoutInflater.java:466) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290) at android.app.Activity.setContentView(Activity.java:1943) at cn.xs8.app.activity.Xs8_BaseActivity.onCreate(Xs8_BaseActivity.java:74) at cn.xs8.app.activity.news.Xs8_News_SplashActivity.onCreate(Xs8_News_SplashActivity.java:95) at android.app.Activity.performCreate(Activity.java:5174) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2164) ... 11 more
查看了很多资料都没解决,仔细看看就是没有找到资源文件,看看res/下面的资源文件,全放在drawable-mdpi/目录下,突然灵光一现,怀疑寻找的位置资源文件不存在,于是将drawable-mdpi/下的资源文件拷贝一份到drawable-ldpi/目录下,还是报上面的错误,再拷贝一份到drawable-hdpi/目录下,问题解决。
还有另外一种解决方法是在res/下建一目录drawable/,将drawable-mdpi/下所有的资源文件都拷贝到drawable/下即可
android.view.InflateException: Binary XML file 解决方案
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。