Skip to content

Ship ExifInterface so a HEIC image does not crash Android - #60371

Draft
ide wants to merge 1 commit into
react:mainfrom
expo:@ide/android-heic-exifinterface
Draft

ide wants to merge 1 commit into
react:mainfrom
expo:@ide/android-heic-exifinterface

Conversation

@ide

@ide ide commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

Summary:

Fresco 3.9.0 reads a HEIF image's EXIF orientation with androidx.exifinterface.media.ExifInterface (com.facebook.imageutils.HeifExifUtil.getOrientation, in imagepipeline-base). No Fresco 3.9.0 artifact declares a dependency on androidx.exifinterface, and neither does ReactAndroid. An app that does not depend on ExifInterface some other way throws when it decodes its first HEIC or HEIF image:

java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/exifinterface/media/ExifInterface;
        at com.facebook.imageutils.HeifExifUtil.getOrientation(HeifExifUtil.kt:31)
        at com.facebook.imagepipeline.image.EncodedImage.internalParseMetaData(EncodedImage.java:396)

HeifExifUtil catches only IOException, and the error is thrown on a background thread, so it ends the process.

ReactAndroid now depends on androidx.exifinterface:exifinterface 1.4.2, declared in the version catalog, so every app that gets Fresco through React Native also gets the class.

Changelog:

[ANDROID] [FIXED] - Include the ExifInterface dependency that Fresco needs to decode HEIC and HEIF images

Test Plan:

Checked on upstream/main 94aee19ac9 (2026-11-28):

  • None of the 18 Fresco 3.9.0 POMs on Maven Central that I fetched (fresco, imagepipeline, imagepipeline-base, fbcore, drawee, middleware, ui-common, ui-core, imagepipeline-okhttp3, imagepipeline-native, the three memory-type-*, nativeimagefilters, nativeimagetranscoder, urimod, vito-source, soloader) mentions exifinterface.
  • javap -p -c on HeifExifUtil from imagepipeline-base-3.9.0.aar shows new androidx/exifinterface/media/ExifInterface with an exception table that covers only java/io/IOException.
  • androidx.exifinterface:exifinterface:1.4.2 exists on Google's Maven repository.
  • java -jar node_modules/ktfmt/lib/ktfmt.jar --dry-run --set-exit-if-changed packages/react-native/ReactAndroid/build.gradle.kts: clean. git diff --check: clean.

Run on this base (2026-11-28):

./gradlew :packages:react-native:ReactAndroid:dependencyInsight --dependency androidx.exifinterface --configuration debugRuntimeClasspath -Preact.internal.useHermesStable=true --console=plain
  • main: "No dependencies matching given input were found in configuration ':packages:react-native:ReactAndroid:debugRuntimeClasspath'".
  • This branch: androidx.exifinterface:exifinterface:1.4.2 on that runtime classpath.

Not run: decoding a HEIC image on a device or emulator.

🤖 Generated with Claude Code

Fresco 3.9.0 reads a HEIF image's EXIF orientation with
`androidx.exifinterface.media.ExifInterface`
(`HeifExifUtil.getOrientation`), but no Fresco artifact declares that
dependency and neither does ReactAndroid. An app that does not depend
on ExifInterface some other way throws `NoClassDefFoundError` when it
decodes its first HEIC or HEIF image. Fresco catches only `IOException`
there, and the error is thrown on a background thread, so it ends the
process.

Make `androidx.exifinterface:exifinterface` 1.4.2 a dependency of
ReactAndroid so that every app that gets Fresco through React Native
also gets the class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging. label Nov 28, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Nov 28, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Meta Review Required This PR is considered risky and requires Meta to import it to do more testing before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant