2

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.

Pankaj
  • 387
  • 1
  • 2
  • 13

4 Answers4

1

There is a "hack" for this

Use android:largeHeap="true" inside Android Manifest file

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?

  1. delete the react native bundle files
  2. Run ./gradlew clean in the terminal
  3. try running react-native run-android --variant=release
Karl Taylor
  • 4,212
  • 2
  • 28
  • 58
Divye Shah
  • 727
  • 1
  • 9
  • 23