I have static image in my react-native app accessing via
<Image source={require("../assets/[email protected]")} />
in development it is showing well but in production release APK is not showing what can be the reason? I have followed steps mention here.
https://facebook.github.io/react-native/docs/signed-apk-android.html
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.
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/
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With