question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Image not showing in release build, black color image only showing (Updated)

See original GitHub issue

Environment

React Native Environment Info: System: OS: Windows 7 CPU: x64 Intel® Core™ i5-7400 CPU @ 3.00GHz Memory: 1.46 GB / 7.89 GB Binaries: Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.1.0.0 AI-173.4907809

Description

It is working perfectly if I do not use images in the release build. In release build instead of images, showing only black space.

I am searching for this problem above one month and I found many answers and I tried all, but all are not working.

Tried answers

  1. react-native bundle --assets-dest ./android/app/src/main/res/ --entry-file ./App.js --bundle-output ./android/app/src/main/assets/index.android.bundle --platform android -dev false
  2. remove all image resizing code

Reproducible Demo

`import React, { Component } from ‘react’; import { Image } from ‘react-native’;

export default class App extends Component { render() { return ( <Image source={require(‘./a.png’)} /> ); } }`

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
merbin2012commented, Oct 17, 2018

@radko93 Thanks for your response Now I have updated to the latest version and tried the same problem still found. The images are shown in “react-native run-android” command. But not showing when I run this command “react-native run-android --variant=release”.

If run the following command before the run-android, it shows “error duplicate resources” “react-native bundle --assets-dest ./android/app/src/main/res/ --entry-file ./App.js --bundle-output ./android/app/src/main/assets/index.android.bundle --platform android --dev false

react-native info : D:\cordova projects\React Native\NewApp>react-native info

React Native Environment Info: System: OS: Windows 7 CPU: x64 Intel® Core™ i5-7400 CPU @ 3.00GHz Memory: 1.46 GB / 7.89 GB Binaries: Yarn: 1.9.4 - C:\Program Files (x86)\Yarn\bin\yarn.CMD npm: 5.6.0 - C:\Program Files\nodejs\npm.CMD IDEs: Android Studio: Version 3.1.0.0 AI-173.4907809

1reaction
TheSaviorcommented, Mar 19, 2019

It sounds like this has been resolved with the latest versions of tools. Let us know if you still run into this on the latest release.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Image Not Visible/Blank When Placing EPS Files into new file
I use a program called Separation Studio to separate raster images into spot colors. I then open up a new Illustrator file, ...
Read more >
iOS Launch screen not showing image when changing bundle ...
1 Answer 1 · Remove application from the device · Restart device · Build again.
Read more >
Lift a subject from the photo background on iPhone
Open a photo. Touch and briefly hold the subject of the photo. When it's outlined, do one of the following: Tap Copy, then ......
Read more >
PlayStation 5 Black Screen - iFixit
If another device shows a working image with no issues, the problem likely comes from the PS5, possibly from its HDMI connection. If...
Read more >
Troubleshooting - ImageJ Wiki
Common issues · The image I loaded is displayed all black! But it is not black! · The image colors do not match...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found