fix(jni) ensure correct export of react/uimanager headers in prefab#56215
Open
fix(jni) ensure correct export of react/uimanager headers in prefab#56215
Conversation
build.gradle.kts exports src/main/jni/react/fabric → react/fabric/ in the prefab headers, which includes StateWrapperImpl.h. That header does #include <react/uimanager/StateWrapper.h>, but src/main/jni/react/uimanager is not in the prefab export list — so the header is simply missing from the AAR. This was introduced in #55288 where they modified StateWrapperImpl.h to inherit from StateWrapper and added the #include on StateWrapper.h. This has caused Expo's nightlies to break due to the missing header file in the prefabs: - Internally (when RN builds itself): Works fine because all JNI source dirs are on the include path - Externally (when consumers use the published AAR): StateWrapperImpl.h is included in the prefab, it references <react/uimanager/StateWrapper.h>, but that header doesn't exist in the prefab package This commit fixes the above problem by including `src/main/jni/react/uimanager` in the prefab. I have tested and verified this by running this in the root of the repo: ``` ./gradlew :packages:react-native:ReactAndroid:preparePrefab ls packages/react-native/ReactAndroid/build/prefab-headers/reactnative/react/uimanager/ ``` Before the fix the uimanager folder was not found, with the fix it exists and contains the following files: ComponentNameResolverBinding.h StateWrapper.h UIConstantsProviderBinding.h There might be an issue with exporting these files in addition to the missing StateWrapper.h - but it seems like this is an issue with other folders in the jni / prefab - everything in a folder is exported when included for prefab.
|
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this in D98124025. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
When testing React Native nightlies, we got the following error from
react-android-0.86.0-nightly-20260325-d1809f0aa-SNAPSHOT-release:The reason is that build.gradle.kts exports src/main/jni/react/fabric → react/fabric/ in the prefab headers, which includes StateWrapperImpl.h. That header does #include <react/uimanager/StateWrapper.h>, but src/main/jni/react/uimanager is not in the prefab export list — so the header is missing from the AAR.
This was introduced in #55288 where they modified StateWrapperImpl.h to inherit from StateWrapper and added the #include on StateWrapper.h.
This has caused Expo's nightlies to break due to the missing header file in the prefabs:
Fix
This commit fixes the above problem by including
src/main/jni/react/uimanagerin the prefab.Test Plan:
I have tested and verified this by running this in the root of the repo:
Before the fix the uimanager folder was not found, with the fix it exists and contains the following files: ComponentNameResolverBinding.h StateWrapper.h UIConstantsProviderBinding.h
Changelog:
[ANDROID] [FIXED] - Fixed missing StateWrapper.h header in prefabs
Potential Issues
There might be an issue with exporting these files in addition to the missing StateWrapper.h - but it seems like this is an issue with other folders in the jni / prefab - everything in a folder is exported when included for prefab.