Prepared a release build (android) in react native but local images are not visible. I tried some solutions suggested like running the 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/ but still images are not shown in the release build. Any help would be appreciated.
Asked
Active
Viewed 1,372 times
2
Pankaj
- 387
- 1
- 2
- 13
-
Not so familiar with react-native.. But did you try having "homepage":"." in your package.json? https://stackoverflow.com/questions/43011207/using-homepage-in-package-json-without-messing-up-paths-for-localhost – SoorajSethumadhavan Feb 10 '19 at 08:57
-
Did you find a solution? – mtoninelli May 30 '20 at 16:12
4 Answers
1
There is a "hack" for this
Use android:largeHeap="true" inside Android Manifest file
Luka Dumančić
- 116
- 8
0
Try to clean and rebuild the application as because, Android Studio maintain the cache memory when apk buil
Zafar Hussain
- 236
- 2
- 8
0
How you import the local image. This code works fine to import an image:
import { Image } from 'react-native';
import test from '../images/test.png';
<Image resizeMode='cover' source={test} />
Arif
- 5,276
- 3
- 45
- 76
0
Could you try the following?
- delete the react native bundle files
- Run
./gradlew cleanin the terminal - try running
react-native run-android --variant=release
Karl Taylor
- 4,212
- 2
- 28
- 58
Divye Shah
- 727
- 1
- 9
- 23