0

I have images I set up with require() in the constructor in the state.

this.state = {
  image: require('./static/image/noimage.png'),
}

I print this image in render() like this :

<Image source={this.state.image} style={{ width: 120, height: 80 }} />

Then I build an APK with :

EXPO_DEBUG=false expo build:android -t apk

The APK works perfectly in the android emulator and on a real phone, but images only show if network is enabled (WiFi or mobile connection). There is no error message,there is only reserved white space in place of the images.

I need this app to be able to work with no connection at all.

Where am I wrong ?

  • Does this answer your question? [Local images are not visible in React-Native app release build](https://stackoverflow.com/questions/41937443/local-images-are-not-visible-in-react-native-app-release-build) – Bora Sumer Jan 07 '20 at 04:13
  • Instead of using expo, I finally used ./gradlew assembleRelease with a configured key (as explained in the react-native documentation), and it works ! Thanks. – maquiladora Jan 08 '20 at 22:12

1 Answers1

0

Try to use from react-native-elements librarynpm install react-native-elements

EleaCode
  • 139
  • 1
  • 4