React Native Android: static image not showing in release released apk

I have a static image in my application using interaction through

  <Image source={require("../assets/preview-full-img-title-logo@2x.png")} />

in development, it manifests itself well, but in production, the release of the APK does not show what could be the reason? I followed the directions here.

https://facebook.imtqy.com/react-native/docs/signed-apk-android.html
+7
source share
3 answers

This is the team that did this 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 the github question>

+5
source

Make sure the images are in the folder ../resor not ${project}/android/app/src/res. If not, then you need to copy the images to this folder. This can be done using the following response 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/

Android, . - .

+1

I am using response-native v0.59.9 with shrinkResources trueconfiguration shrinkResources true. It makes you react - relatives could not find assets.

Make sure you do not install shrinkResourcesbuild.gradle on android, unless the new version of act-native supports it later.

+1
source

Source: https://habr.com/ru/post/1651209/


All Articles