Skip to content

Test that ReactAndroid ships the ExifInterface Fresco needs - #60420

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
expo:@ide/android-exifinterface-test
Dec 1, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
expo:@ide/android-exifinterface-test

Conversation

@ide

@ide ide commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

Summary:

#60371 made ReactAndroid depend on androidx.exifinterface, which Fresco 3.9.0 uses to read a HEIF image's EXIF orientation but does not declare. No test failed if that dependency was removed.

The new HeifExifOrientationTest calls Fresco's HeifExifUtil.getOrientation, the method that crashed, on a stream that holds an EXIF orientation tag, and expects that orientation back. It goes through Fresco instead of loading the class by name, so it checks what an app needs: if a later Fresco stops using ExifInterface, the test passes without the dependency.

The stream is a JPEG with no image data, the smallest file ExifInterface reads: HeifExifUtil passes the stream to ExifInterface without checking its format, and parsing a real HEIF goes through MediaMetadataRetriever, which Robolectric only stubs.

Changelog:

[INTERNAL] [ADDED] - Test that ReactAndroid provides the ExifInterface class Fresco uses for HEIF images

Test Plan:

./gradlew :packages:react-native:ReactAndroid:testDebugUnitTest --tests com.facebook.react.modules.fresco.HeifExifOrientationTest -Preact.internal.useHermesStable=true --console=plain

The test passes. With implementation(libs.androidx.exifinterface) removed from ReactAndroid/build.gradle.kts it fails as an app did before #60371:

java.lang.NoClassDefFoundError: androidx/exifinterface/media/ExifInterface
	at com.facebook.imageutils.HeifExifUtil.getOrientation(HeifExifUtil.kt:31)

ktfmt is clean.

Fresco reads a HEIF image's EXIF orientation with
`androidx.exifinterface.media.ExifInterface` but does not declare the
dependency, so ReactAndroid declares it. Nothing failed if that
declaration was removed.

Call Fresco's `HeifExifUtil.getOrientation` on a stream with an EXIF
orientation tag and expect the orientation back. Without the dependency
the call throws `NoClassDefFoundError`, as it does in an app.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@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 Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026

Copy link
Copy Markdown

Visual regression

No visual differences at 0540609dfad5.

ios: no capture

@ide
ide marked this pull request as ready for review December 1, 2026 03:05
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Dec 1, 2026
@meta-codesync

meta-codesync Bot commented Dec 1, 2026

Copy link
Copy Markdown

@javache has imported this pull request. If you are a Meta employee, you can view this in D135308452.

@ide

ide commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

@javache Thanks for importing this. The "Facebook Internal - Linter" check fails here, and its result is visible only inside Meta. The file passes yarn format-check-kotlin (ktfmt 0.59.0), so I can't reproduce it. Could you share what it flags? I'll fix it in this PR.

@zeyap zeyap left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
meta-codesync Bot merged commit 2df16e5 into react:main Dec 1, 2026
68 of 72 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ide in 2df16e5

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Dec 1, 2026
@ide
ide deleted the @ide/android-exifinterface-test branch December 1, 2026 17:53
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @ide in 2df16e5

When will my fix make it into a release? | How to file a pick request?

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. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants