Open llr101 opened 5 days ago
I have same issue on "react-native": "0.74.6" only in device, not in simulator.
Tested on Android 9 device.
Seems to work on Android 13 device.
Reducing the reproducer further to:
import React from 'react';
import {SafeAreaView, Image, Button} from 'react-native';
function App(): React.JSX.Element {
const lastRun = new Date().getTime();
const delta = () => new Date().getTime() - lastRun;
return (
<SafeAreaView>
<Image
style={{ width: 100, height: 100 }}
source={{
uri: `https://reactnative.dev/img/tiny_logo.png?r=${Math.random()}`,
}}
onLoad={() => console.warn('onLoad', delta())}
onLoadStart={() => console.warn('onLoadStart', delta())}
onLoadEnd={() => console.warn('onLoadEnd', delta())}
onProgress={() => console.warn('onProgress', delta())}
onError={() => console.warn('onError', delta())}
/>
<Button onPress={() => console.warn('Unblocked')} title="Unblock" />
</SafeAreaView>
);
}
export default App;
I haven't been able to reproduce this locally:
Reducing the reproducer further to:
import React from 'react'; import {SafeAreaView, Image, Button} from 'react-native'; function App(): React.JSX.Element { const lastRun = new Date().getTime(); const delta = () => new Date().getTime() - lastRun; return ( <SafeAreaView> <Image style={{ width: 100, height: 100 }} source={{ uri: `https://reactnative.dev/img/tiny_logo.png?r=${Math.random()}`, }} onLoad={() => console.warn('onLoad', delta())} onLoadStart={() => console.warn('onLoadStart', delta())} onLoadEnd={() => console.warn('onLoadEnd', delta())} onProgress={() => console.warn('onProgress', delta())} onError={() => console.warn('onError', delta())} /> <Button onPress={() => console.warn('Unblocked')} title="Unblock" /> </SafeAreaView> ); } export default App;
I haven't been able to reproduce this locally:
Are you using an Android physical device? What is the version?
Used the provided reproducer (0.76.3) on a emulator.
Works on my Android 13 device but not on Android 9.
Used the provided reproducer (0.76.3) on a emulator.
As tero-paananen said. It seems like fine on emulator, but not ok on Android 9 physical device.
Description
I init a react native project without framework by npx @react-native-community/cli@latest init AwesomeProject. The version is 0.76.3. But image with remote uri load very slow first time in android, and it is ok in ios.
The console just print "onLoadStart", then nothing printed. I wait for about 5 mins, the image loaded, and then reload app, the image shows immediately. But when I changed the image uri and reload app, I need to wait for 5 mins again to load the image. My app is pure and no dependences. Could you help me check it? Thank you
Steps to reproduce
React Native Version
0.76.3
Affected Platforms
Runtime - Android, Build - MacOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/llr101/react-native-android-image-error
Screenshots and Videos
No response