Android. view. InflateException: Binary XML file solution

Source: Internet
Author: User

Android. view. InflateException: Binary XML file solution
Android. view. InflateException: Binary XML file line #2: Error inflating class Solution

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 classat 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 classat 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

I checked a lot of information and did not solve the problem. I did not find the resource file. I checked the resource files under res/and put them all under the drawable-mdpi/directory. Suddenly, the light came into being, if you suspect that the resource file to be searched does not exist, copy the resource file under drawable-mdpi/to the drawable-ldpi/directory and report the error, copy a copy to the drawable-hdpi/directory to solve the problem.

Another solution is to create a directory named drawable/under res/and copy all the resource files under drawable-mdpi/to drawable /.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.