Splash screen error: android.content.res.Resources$NotFoundException: Drawable

Thanks to Alexander for narrowing down the error, I found this post that fixes exactly my issue:

I fixed my splash_background.xml to this:

<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item
            android:drawable="@color/colorPrimary"/>

    <item>
        <bitmap
                android:gravity="center"
                android:src="@drawable/ic_launcher"/>
    </item>

</layer-list>

Apparently, the src you need needs to be in the drawable folder and it has be a .png not a .xml


For my part, this solution did not solve the problem. To fix it I declare the background image of the splash screen like this:

<item android:drawable="@color/colorPrimary" />

<item
    android:drawable="@drawable/ic_launcher"
    android:gravity="center" />


If you look this line here:

Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #8: requires a valid 'src' attribute

It seems that the issue is an invalid source for an drawable in your layout.