Problem
React-native version 0.53.3
React-native-splash-screen version 3.0.6
When everything is properly configured, the following issues occur:
Debug Error in Android Studio isandroid.content.res.Resources$NotFoundException: Resource ID #0x7f040038 type {这里是#什么的} is not valid
Reason
React-native-splash-screen versions 3.0.1 and 3.0.6 differ
The differences are as follows, the following is 3.0.6 Version:
The newly referenced color can be seen by these two files. primary_dark
Refs.xml
Styles.xml
Solve
The problem occurs when a new version of the referenced color is not found, so the workaround is as follows:
Create a new file in the project android/app/src/main/res/values/
directory colors.xml
and add the value that the new version references to primary_dark
:
<?xml version="1.0" encoding="utf-8"?><resources> <color name="primary_dark">#000000</color></resources>
Re react-native run-android
-fix it.
React-native-splash-screen plugin Android App crash issue