Skip to content

fix(android): respect reactNativeArchitectures to skip unnecessary ABI builds - #1970

Open
SscSPs wants to merge 1 commit into
Nozbe:masterfrom
SscSPs:master
Open

fix(android): respect reactNativeArchitectures to skip unnecessary ABI builds#1970
SscSPs wants to merge 1 commit into
Nozbe:masterfrom
SscSPs:master

Conversation

@SscSPs

@SscSPs SscSPs commented Jun 6, 2026

Copy link
Copy Markdown

Summary

When the parent project passes -PreactNativeArchitectures (or -Preact.nativeArchitectures), the android-jsi library currently compiles native code for every NDK ABI — including x86, x86_64, etc. — regardless of the specified filter.

This adds an ndk.abiFilters block inside defaultConfig that reads the property from rootProject. When the property is set, CMake/ninja only builds for the requested architectures, saving build time and disk space. When unset, the list stays empty which is a no-op (all ABIs are built — same as before).

Motivation

In a React Native project configured with e.g. :app:bundleRelease -PreactNativeArchitectures=arm64-v8a,armeabi-v7a, the app module correctly filters its native builds — but library modules like watermelondb-android-jsi ignore this flag and compile for the full NDK matrix. This is wasted CPU time (and disk space during local/EAS builds) since the AAB packaging strips unneeded architectures anyway.

Testing

  • Applied to a local EAS build — only the specified ABIs are now compiled by WatermelonDB's CMake
  • Backward compatible — when the property is absent, abiFilters is an empty list, preserving existing behavior

Fixes #___

Fixes #1971

…I builds

When the parent project passes -PreactNativeArchitectures (or
-Preact.nativeArchitectures), the android-jsi library currently builds
native code for every NDK ABI (arm64-v8a, armeabi-v7a, x86, x86_64,
etc.) regardless of the specified filter.

This adds an ndk.abiFilters block inside defaultConfig that reads the
property from rootProject. When unset the list stays empty, which is a
no-op (every ABI is built — same as before). When set, CMake/ninja
only compiles for the requested architectures, saving build time and
resources.

Fixes #___
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

android-jsi CMake builds for all NDK ABIs regardless of reactNativeArchitectures filter

1 participant