react / react/react-native

Image defaultSource on Android Builds behaves differently than iOS

Abierto
#41,124 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Component: Image Issue: Author Provided Repro Needs: Triage :mag: Platform: Android Platform: iOS
Lenguaje dominante
C++
Estrellas
127k
Forks
25.3k
Merge medio
1 d 23 h
PR fusionados (30 d)
4

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Ejecuta la react-native-android-image-defaultSource-repro enlazada con React Native 0.72.6 y compara la salida de release de Android con la documentación de defaultSource y los issues referenciados #31287 y #38875. Rastrea el procesamiento de Android Image implicado en la secuencia de carga en modo release. Se considera completado cuando defaultSource local siga mostrándose correctamente mientras se carga la imagen remota, coincidiendo con el comportamiento esperado y sin la desaparición reportada.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
react-native
Área
mobile-dev
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.