I have static image in my react-native app accessing via
I'm using RN 0.61.2
As stated by @made-in-moon here this worked for me:
react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
For iOS 14 one can also upgrade to the latest version of react-native 0.63.3
I'm using react-native v0.59.9 with shrinkResources true
configuration.
It makes react-native could not find the assets.
Make sure you do not set shrinkResources
on android build.gradle unless the new version of react-native support it later on.
This is the command that did it for me:
react-native bundle --platform android --dev false --entry-file index.android.js \ --bundle-output android/app/src/main/assets/index.android.bundle \ --assets-dest android/app/src/main/res/
take a look at github issue>
Verify whether images are in ../res
folder or not ${project}/android/app/src/res
. If not then you need to copy images in that folder. That can be done using following react command
react-native bundle --platform android --dev false --entry-file index.android.js \ --bundle-output android/app/src/main/assets/index.android.bundle \ --assets-dest android/app/src/main/res/
Ideally, this happens in Android when images sizes are larger. Another way to avoid such issues at runtime is to optimize image sizes.