android.content.res.Resources$NotFoundException: File res/drawable-v21/launch_background.xml android.content.res.Resources$NotFoundException: File res/drawable-v21/launch_background.xml xml xml

android.content.res.Resources$NotFoundException: File res/drawable-v21/launch_background.xml


In file android\app\src\main\res\drawable-v21\launch_background.xml, the exception can be solved by replacing

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">    <item android:drawable="?android:colorBackground" />

by

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">    <item android:drawable="@android:color/white" />


In file android/app/src/main/AndroidManifest.xml, the exception is resolved by commenting out this:

<meta-dataandroid:name="io.flutter.embedding.android.SplashScreenDrawable"android:resource="@drawable/launch_background" />

Removing the above resolves the exception, although I'm not sure if it has any side effect.


Original answer found here : Splash screen error: android.content.res.Resources$NotFoundException: Drawable

This issue happens most of the times when you include images from directory other than drawable. For eg:

<item>  <bitmap       android:gravity="center"       android:src="@mipmap/image" /></item>

Just use a image from drawable and you will get rid of the error.