react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

Require .avif Image not work: None of these files exist...

Open erie-e9 opened this issue 1 year ago • 1 comments

Describe the bug I just tested local images, .avif, .png and .webp formats, only avif format is facing problems. All of them are working fine coming from server.

To Reproduce Use this package with local .avif image. Note: This was tested only on iOS simulator, cannot test it on Android devices yet.

<FastImage
        // attempt 1
           source={require('./profile.avif')}

        // attempt 2
        // source={{
            //  uri: Image.resolveAssetSource(require('@assets/shared/images/profile.avif')).uri,
        // }}

        // attempt 3
           //source={{ uri: Image.resolveAssetSource(require('./profile.avif')).uri }}

         resizeMode={FastImage.resizeMode[resizeMode || 'contain']}
         style={{
           width: 40, height: 40, borderRadius: 30, padding: 10,
          }}
      />

Expected behavior

  • Should display local .avif image.
  • url works: https://aomedia.org/assets/images/blog/parrot-avif.avif or any other url
  • local paths don't work: @assets/shared/images/profile.avif or ./profile.avif

I'm pretty sure path file is correct and it exists.

Screenshots

Alt Text Image

Dependency versions

  • React Native version: 0.78.0
  • React version: 19.0.0
  • React Native Fast Image version: 8.9.2
  • Hermes and New arch enabled

erie-e9 avatar Mar 02 '25 00:03 erie-e9

I saw your issue randomly on the internet and wanted to try to contribute by explaining that minimum support for the AVIF format only arrived in Android 12 with a definitive one only in 14

If your emulator/physical device is running Android 11 or less, it will not work

On the iOS side, the minimum is 16

chartliex avatar Apr 18 '25 01:04 chartliex