Skip to content

Android: AAR does not bundle libreactnative.so (RN 0.83+ merged .so) #311

@OctavianTocan-TwinMind

Description

@OctavianTocan-TwinMind

In React Native 0.83+, multiple .so files (librninstance.so, libreact_featureflagsjni.so, libyoga.so, etc.) were merged into a single libreactnative.so via MergedSoMapping. The brownfield Gradle plugin v1.0.2 only bundles libappmodules.so and libreact_codegen_*.so in the AAR. It does NOT bundle libreactnative.so or libc++_shared.so, which causes SoLoaderDSONotFoundError crashes in consumer apps.

The dynamicLibs feature mentioned in the README (from PR #128) is not available in the released v1.0.2 plugin.

Workaround: inject a Gradle afterEvaluate copy task that copies libreactnative.so and libc++_shared.so from the app build intermediates into the module's jni directory. Consumer must also pass OpenSourceMergedSoMapping to SoLoader.init() and call DefaultNewArchitectureEntryPoint.load().

Tested with: plugin 1.0.2, React Native 0.83.6, Expo SDK 55.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions