位置:主页 > 互联网技术 >

android.view.InflateException: Binary XML file 解决方案

作者:AG集&#时间:2019-02-06

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/下即可

http://www.bkjia.com/Androidjc/887393.htmlwww.bkjia.comtruehttp://www.bkjia.com/Androidjc/887393.htmlTechArticleandroid.view.InflateException: Binary XML file 解决方案 android.view.InflateException: Binary XML file line #2: Error inflating class 的解决方法 java.lang.RuntimeException...

本文源自: 凯发娱乐

上一篇:android:descendantFocusability用法简析,

下一篇:没有了

互联网技术

联系我们