Passing a multi-element array to Image causes a crash on Android

This issue has been created since 2022-09-16.

Description

Hey RN maintainers,

I've made a repo with this one, which I hope is reproducible. The crash happens at least on Android Emulator, but we've also reproduced it on a Pixel 5. The repo was created with expo, but I'm not sure if that makes much of a difference.

The error message is Error while updating property 'src' of a view managed by: RCTImageView.

I've also posted this question on StackOverflow, as it might be a mistake on my end instead of an actual bug.

Version

0.69.5

Output of npx react-native info

info Fetching system and libraries information...
System:
    OS: macOS 12.6
    CPU: (8) arm64 Apple M1
    Memory: 775.95 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.7.0 - ~/.nvm/versions/node/v18.7.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v18.7.0/bin/yarn
    npm: 8.18.0 - ~/.nvm/versions/node/v18.7.0/bin/npm
    Watchman: 2022.07.04.00 - /opt/homebrew/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
    Android SDK: Not Found
  IDEs:
    Android Studio: 2021.2 AI-212.5712.43.2112.8815526
    Xcode: 14.0/14A309 - /usr/bin/xcodebuild
  Languages:
    Java: 15.0.2 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 18.0.0 => 18.0.0 
    react-native: 0.69.5 => 0.69.5 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

Steps to reproduce

I've made a repo, opening it on Android Emulator crashes the app on launch.

Snack, code example, screenshot, or link to a repository

https://github.com/flowchase/break-image-component

danilobuerger wrote this answer on 2022-09-20

Does it work when you add width and height to each source object in the array?

filipecatraia wrote this answer on 2022-09-20

@danilobuerger Yes, that makes the problem go away. With these network images I can't be sure what width/heights I'll be getting, as they are assets uploaded by the team; that would make it impossible to know the width/height beforehand.

danilobuerger wrote this answer on 2022-09-20

The error message could be better, but the docs are clear:

This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments.

https://reactnative.dev/docs/image#source

filipecatraia wrote this answer on 2022-09-20

Damn, I missed that. Do you know why it doesn't break on iOS?

danilobuerger wrote this answer on 2022-09-20

No, but you could investigate it. Maybe there is a way to not require it at all on both platforms.

filipecatraia wrote this answer on 2022-09-20

Interestingly this is recent, since we upgraded to RN 0.69.5. Android didn't crash in our last build.

@danilobuerger Yeah, fair enough. Thanks for your help!

cortinico wrote this answer on 2022-09-20

Can we consider this resolved?

filipecatraia wrote this answer on 2022-09-21

I'd argue the behavior is sub-optimal and a ‘regression’. But by all means, go ahead and close it, as it is technically the expected result.

More Details About Repo
Owner Name facebook
Repo Name react-native
Full Name facebook/react-native
Language JavaScript
Created Date 2015-01-09
Updated Date 2022-10-07
Star Count 105180
Watcher Count 3671
Fork Count 22481
Issue Count 2230

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
What does With_Prior_Reservation do? 4 2022-10-03 2022-10-05
Diagnostic shows errors incorrectly 1 2022-01-05 2022-09-14
Changing frame time in the middle of a game conundrum 4 2021-08-26 2022-08-04
AMAI vs AI uses an outdated blizzard.j 1 2020-06-16 2022-10-01
DBUseArea() searches for files to open first in the exe folder, instead of the SetDefault() folder 2 2022-01-13 2022-08-02
Migrate from Travis CI to GitHub Actions? 1 2022-07-08 2022-08-08
Service database username avnadmin does not exist status 403 2 2021-09-03 2022-09-12
ubuntu MiKTeX 2.9.6840 \[email protected]= 6 2018-12-18 2022-08-23
HDMI aspect ratio incorrect 2 2021-06-17 2022-08-12
Raise error if data type domain differs between R and database 6 2020-08-26 2022-09-26
Can the ImageSelected event be triggered when the ImageSelector closes the image? 0 2022-06-23 2022-09-13
mcuboot when configured to validate primary slot on every boot and with a different key used to sign the image seems to boot image regardless 2 2021-10-07 2022-09-16
Reduce scriptSig length for Lelantus transactions 4 2021-05-06 2022-09-13
[coc.nvim] Error on request (diagnosticList) 11 2022-06-04 2022-10-01
Folder Arrows are not being rendered 4 2022-06-04 2022-09-22
Update electron to support native wayland 3 2022-05-11 2022-07-08
Navigating away from a draft reply message loses the association with the quoted message. 0 2022-05-13 2022-07-08
Can we get host from cassandra session? 1 2022-09-01 2022-09-12
ShakeDigest uses exactly 32 outputbytes 1 2021-09-27 2022-06-28
Read Receips not marking messages as read anymore 2 2021-12-16 2022-09-16
Jeux non en français 8 2021-08-23 2022-09-05
`Alert`s can be left without calling any commands on them 0 2021-10-03 2022-09-20
We have a memory leak at src/transport.c:474 5 2021-09-02 2022-09-04
gorgone api only returns no_log for finished gorgone_actions and wrong response for internal endpoints 12 2021-06-10 2022-09-17
Xresources doesn't have orange, hard black and grays 9 2022-07-12 2022-09-22
problems about sys.stdin.read() in ipython console 6 2021-12-09 2022-09-30
自定义数组类型不能用方括号 0 2021-09-01 2021-11-25
Support rejecting/dropping mail based on From domain 4 2022-01-05 2022-09-25
When running OMV 6.x and you need to apply configuration changes you don't know what they are 7 2022-08-16 2022-09-30
No users show in assignment list 1 2022-03-07 2022-10-03
Valet on Windows 10 Issue 4 2019-09-16 2022-10-02
Valet not working with WiFi adapter 3 2019-07-12 2022-09-15
Coding Issue in panel-addto.c 2 2021-02-06 2022-07-28
Add option to control urgent windows behavior 1 2021-02-12 2022-07-26
cilium connectivity test hand on Waiting for CiliumEndpoint 1 2022-05-07 2022-10-07
CFP: make packet too big work in ECMP scenarios 2 2022-05-06 2022-10-07
Task View animations are broken 27 2020-08-23 2022-10-05
Geolocator.getCurrentPosition is very slow on ios 14 2 2021-11-05 2022-09-27
[Event Request] Codeunit 80 "Sales-Post" - OnBeforePostItemTracking 2 2022-05-27 2022-10-04
Everything related to spawn and schedule has been removed 3 2020-10-08 2021-12-26
toc and link conflict 0 2020-02-02 2022-08-19
Additional github API endpoints? 2 2017-10-20 2022-08-22
Use actual full original URL when sharing with original URL 1 2021-10-22 2022-08-22
Missing files dosen't include missing 'Image Mask/Blend' filter path 1 2021-08-24 2022-09-17
Support value as object name 2 2019-03-24 2022-10-01
[BUG] start and stopTrackPage event in Angular app do not work 1 2022-03-02 2022-09-14
呜呜呜大佬为什么插件我这边不能用啊 3 2021-11-08 2022-01-20
Dashboard sharing GA change events are raised when no change is made 9 2022-06-30 2022-07-20
Show / Hide on tray icon is too slow to toggle 4 2022-02-14 2022-09-10
downstream tasks "upstream failed" when upstream retries and succeeds 17 2021-09-21 2022-08-26