引起:android.view.InflateException:二进制XML文件行#0:错误膨胀类android.widget.RelativeLayout

时间:2018-02-19 11:07:52

标签: java android android-xml

我的应用程序停止并且我在第0行上出现了二进制XML文件错误。它有点奇怪,因为我没有看到这样的问题,第0行,错误膨胀类android.widget.RelativeLayout。所以每个人都需要你的帮助。 如果在启动活动中发生错误 setContentView(R.layout.activity_splash_screen);

animantion_loading.xml

<animation-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/frame1" android:duration="90"/>
    <item android:drawable="@drawable/frame2" android:duration="90"/>
    <item android:drawable="@drawable/frame3" android:duration="90"/>
    <item android:drawable="@drawable/frame4" android:duration="90"/>
</animation-list>

activity.xml

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/watermarksplash"
    tools:context="com.example.sankar.nestfindersapp.Activity.SplashScreenActivity">

    <ImageView
        android:layout_width="800dp"
        android:layout_height="800dp"
        android:id="@+id/imgeview"
        tools:layout_editor_absoluteY="78dp"
        tools:layout_editor_absoluteX="104dp"
        />

</RelativeLayout>

错误

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.sankar.nestfindersapp, PID: 22485
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.sankar.nestfindersapp/com.example.sankar.nestfindersapp.Activity.SplashScreenActivity}: android.view.InflateException: Binary XML file line #0: Error inflating class android.widget.RelativeLayout
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2456)
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517)
                          at android.app.ActivityThread.access$800(ActivityThread.java:163)
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413)
                          at android.os.Handler.dispatchMessage(Handler.java:106)
                          at android.os.Looper.loop(Looper.java:189)
                          at android.app.ActivityThread.main(ActivityThread.java:5550)
                          at java.lang.reflect.Method.invoke(Native Method)
                          at java.lang.reflect.Method.invoke(Method.java:372)
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015)
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810)
                       Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class android.widget.RelativeLayout
                          at android.view.LayoutInflater.createView(LayoutInflater.java:633)
                          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55)
                          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682)
                          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:482)
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
                          at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
                          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
                          at com.example.sankar.nestfindersapp.Activity.SplashScreenActivity.onCreate(SplashScreenActivity.java:19)
                          at android.app.Activity.performCreate(Activity.java:5966)
                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517) 
                          at android.app.ActivityThread.access$800(ActivityThread.java:163) 
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413) 
                          at android.os.Handler.dispatchMessage(Handler.java:106) 
                          at android.os.Looper.loop(Looper.java:189) 
                          at android.app.ActivityThread.main(ActivityThread.java:5550) 
                          at java.lang.reflect.Method.invoke(Native Method) 
                          at java.lang.reflect.Method.invoke(Method.java:372) 
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015) 
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810) 
                       Caused by: java.lang.reflect.InvocationTargetException
                          at java.lang.reflect.Constructor.newInstance(Native Method)
                          at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
                          at android.view.LayoutInflater.createView(LayoutInflater.java:607)
                          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) 
                          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) 
                          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) 
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:482) 
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                          at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
                          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
                          at com.example.sankar.nestfindersapp.Activity.SplashScreenActivity.onCreate(SplashScreenActivity.java:19) 
                          at android.app.Activity.performCreate(Activity.java:5966) 
                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409) 
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517) 
                          at android.app.ActivityThread.access$800(ActivityThread.java:163) 
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413) 
                          at android.os.Handler.dispatchMessage(Handler.java:106) 
                          at android.os.Looper.loop(Looper.java:189) 
                          at android.app.ActivityThread.main(ActivityThread.java:5550) 
                          at java.lang.reflect.Method.invoke(Native Method) 
                          at java.lang.reflect.Method.invoke(Method.java:372) 
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015) 
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810) 
                       Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.sankar.nestfindersapp:drawable/watermarksplash" (7f0800dc)  is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f0800dc a=-1 r=0x7f0800dc}
                          at android.content.res.Resources.loadDrawableForCookie(Resources.java:2704)
                          at android.content.res.Resources.loadDrawable(Resources.java:2644)
                          at android.content.res.TypedArray.getDrawable(TypedArray.java:771)
                          at android.view.View.<init>(View.java:3775)
                          at android.view.ViewGroup.<init>(ViewGroup.java:513)
                          at android.widget.RelativeLayout.<init>(RelativeLayout.java:262)
                          at android.widget.RelativeLayout.<init>(RelativeLayout.java:258)
                          at android.widget.RelativeLayout.<init>(RelativeLayout.java:254)
                          at java.lang.reflect.Constructor.newInstance(Native Method) 
                          at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
                          at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
                          at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) 
                          at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) 
                          at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) 
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:482) 
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
                          at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
                          at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
                          at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139) 
                          at com.example.sankar.nestfindersapp.Activity.SplashScreenActivity.onCreate(SplashScreenActivity.java:19) 
                          at android.app.Activity.performCreate(Activity.java:5966) 
                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409) 
                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2517) 
                          at android.app.ActivityThread.access$800(ActivityThread.java:163) 
                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1413) 
                          at android.os.Handler.dispatchMessage(Handler.java:106) 
                          at android.os.Looper.loop(Looper.java:189) 
                          at android.app.ActivityThread.main(ActivityThread.java:5550) 
                          at java.lang.reflect.Method.invoke(Native Method) 
                          at java.lang.reflect.Method.invoke(Method.java:372) 
                          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1015) 
                          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:810) 
    Application terminated.
    enter code here

0 个答案:

没有答案