React Native Bootsplash Library - Android resource linking failed

46 Views Asked by At

I installed the Bootsplash library and it works fine on iOS. But when I want to run it on Android, I get the following error; ERROR:quiz_app/android/app/build/intermediates/incremental/debug/mergeDebugResources/merged.dir/values/values.xml:5506: AAPT: error: resource color/bootsplash_background (aka com.quiz_app:color/bootsplash_background) not found.

My assets folder includes SplashScreenLogo.png

MainActivity.java

enter image description here
MainActivity.java styles.xml

react-native version: 0.72.6
react-native-bootsplash version: 5.0.4

How can I fix this problem ?

Thanks for reading.

I changed the name of my SplashScreenLogo.png file to bootsplash_logo but it didn't work. I ran the ./gradlew clean command and compiled the application again but it didn't work.

1

There are 1 best solutions below

0
sj_959 On

This is likely happening because you haven't created (or modified) the colors.xml file properly. The color bootsplash_background is missing from the file.

Navigate to android/app/src/main/res/values/colors.xml in your project (or create the file if it doesn't exist) and add the following content:

<resources>
    <color name="bootsplash_background">#ffffff</color>
</resources>

If the file already has some colors defined, just add the bootsplash_background one under any color and rebuild the app.