Expo App Not Displaying Custom Icon and Splash Image
I pulled down the repo for our mobile app, added our custom PNG image files into the assets folder, updated the paths in app.json for "icon" and "splash". I expected this to display custom app icon and splash screen images. However, when I run our npm run android
script, which builds and runs the app by running expo run:android
, the default Expo icon is still displayed for the app icon and app splash page.
- Checked and verified the file paths. The paths specified in app.json for my assets are:
"icon": "./src/assets/images/icon.png",
"splash": {
"image": "./src/assets/images/splash.png"
}
}
I even confirmed the image's location using the command ls ./src/assets/images/icon.png
.
- Ensured the images are in PNG format.
- Cleared caches using
expo start --clear
, deletednode_modules
, and executed fresh dependency installations. - Reset the data on the Android Virtual Device (AVD).
- Created a test app using
npx create-expo-app
. This app successfully displayed the custom splash image (but not the icon image, since it was running in Expo Go) when I rannpm run android
. - I realized that the test app's script was running
expo start --android
while the main app's script was runningexpo run:android
. I modified this to match the test app's script and saw the same behavior as with the test app. However, I need it to run and work withexpo run: android
. - I tried to run the app on a physical device but ran into problems when when trying to scan the QR code.
I don't have a ton of mobile dev experience and am pretty stuck at this point. If you have any ideas or have run into this before, I'd really appreciate some help. Thanks!
Source: View source