React-native: Android O (8.0) some Image(png) failed to be loaded [Android]

Created on 13 Sep 2017  路  10Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

  1. react-native -v: 0.48.3
  2. node -v: 7.8.0
  3. npm -v: 4.2.0
  4. yarn --version:

Then, specify:

  • Target Platform: Android

  • Development Operating System: macOS Sierra v10.12.6

  • Build tools:

Steps to Reproduce

(Write your steps here:)

  1. Create Image.
  2. Some Images failed to be loaded on Android 8.0. I've tried both static image using 'require' and dynamic image using 'uri'. This is specific only to Android 8.0. I have tried it with Android 7.0 and iOS and this issue does not exist in those platforms. In this example, I added two images to the screen. One is problematic, the other one is not.

Expected Behavior

Both images should be loaded like in iOS screenshot.

image error ios

Actual Behavior

Only the non-problematic image is loaded. In Android 7, this issue does not exist.

image error android

Reproducible Demo

https://github.com/Proyoyo/imageErrorDemo

  1. Clone repo.
  2. Run npm install.
  3. Run demo in Android 8.0.

Stale

All 10 comments

change the phone

I found more information regarding the issue. It seems that 16-bit png image always fails to load in Android O. 8-bit png image works fine. Both 8-bit and 16-bit works fine on Android 7 and below and iOS.

8-bit images are not working either if file is big enough. Tried with PNG image data, 2664 x 2664, 8-bit/color RGBA, non-interlaced.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

OS: Android 8.
react native 0.49.3.

I'm also having problems rendering images in Android 8. I still can't seem to find the root cause. this is one image that doesn't render https://s3.amazonaws.com/px-assets-dev/uploads/0000002519-7330f574cc4eeba3c3036717c560ca9b-000000003974.png

so any way to solve this ??

鎴戝湪瀹夊崜8.1鐗堟湰鏃犳硶鏄剧ず鍥惧儚

@Proyoyo Thanks,I fixed the bug by converting png to 8-bit. :rose:

Apparently this bug still exists.
Image appears on Xiaomi Mi 3 with Android 6.0.1,
but does not appears on Samsung Galaxy Note 8 with Android 8.0.0.
The Image is a 32-bit PNG of size 12.7kb.

We should convert the image. it's will be okay

Was this page helpful?
0 / 5 - 0 ratings