Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
erie-e9 opened this issue Mar 2, 2025 · 1 comment
Open

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

erie-e9 opened this issue Mar 2, 2025 · 1 comment
Labels

Comments

@erie-e9
Copy link

erie-e9 commented Mar 2, 2025

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 erie-e9 added the bug label Mar 2, 2025
@chartliex
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants