react / react/react-native

Image defaultSource on Android Builds behaves differently than iOS

未关闭
#41,124 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

Component: Image Issue: Author Provided Repro Needs: Triage :mag: Platform: Android Platform: iOS
主要语言
C++
星标
127k
派生
25.3k
平均合并
1 天 23 小时
30 天内合并 PR
4

描述

Description

Similar to closed issues that were missing repro links -

https://github.com/facebook/react-native/issues/31287
https://github.com/facebook/react-native/issues/38875

Based on the documentation https://reactnative.dev/docs/image#defaultsource Image defaultSource on Android gets ignored on debug but should work on release mode.

No issues on iOS new and old architecture
Android not working as expected new and old architecture

React Native Version

0.72.6

Output of npx react-native info

System:
OS: macOS 13.3.1
CPU: (10) arm64 Apple M1 Pro
Memory: 165.50 MB / 16.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 16.14.2
path: ~/.nvm/versions/node/v16.14.2/bin/node
Yarn:
version: 1.22.19
path: ~/.nvm/versions/node/v16.14.2/bin/yarn
npm:
version: 8.5.0
path: ~/.nvm/versions/node/v16.14.2/bin/npm
Watchman:
version: 2023.02.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.12.1
path: /Users/gurung/.asdf/shims/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 22.4
- iOS 16.4
- macOS 13.3
- tvOS 16.4
- watchOS 9.4
Android SDK:
API Levels:
- "30"
- "31"
- "32"
- "33"
Build Tools:
- 30.0.3
- 31.0.0
- 32.0.0
- 33.0.0
System Images:
- android-30 | Google APIs ARM 64 v8a
- android-31 | Google APIs ARM 64 v8a
- android-31 | Google Play ARM 64 v8a
- android-32 | Google APIs ARM 64 v8a
- android-33 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2021.1 AI-211.7628.21.2111.8309675
Xcode:
version: 14.3/14E222b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 11.0.17
path: /usr/bin/javac
Ruby:
version: 3.0.3
path: /Users/gurung/.asdf/shims/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.72.6
wanted: 0.72.6
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Steps to reproduce

Add Image with defaultSource that points to local image path and source with remote image.

run yarn android --mode release

Expected

https://github.com/facebook/react-native/assets/6507800/333a02b4-2e46-4876-ba7d-6dfad820658e

Actual

It seems to render defaultSource briefly and when it's actually trying to load the remote image it disappears, but reappears briefly before rendering the remote image.

https://github.com/facebook/react-native/assets/6507800/5e90be48-0a1d-4b5b-abc2-87866812fa81

Snack, screenshot, or link to a repository

https://github.com/grgmo/react-native-android-image-defaultSource-repro

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用 React Native 0.72.6 运行链接的 react-native-android-image-defaultSource-repro,并将 Android release 输出与 defaultSource 文档以及引用的 issue #31287 和 #38875 进行比较。跟踪 release-mode 加载序列中涉及的 Android Image 处理。完成的标准是:在远程图像加载期间,本地 defaultSource 仍能正确显示,符合预期行为,且不会出现报告中的消失问题。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native
领域
mobile-dev
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。