Skip to content

Commit c7dfe9e

Browse files
j-piaseckisatya164
andauthored
fix: add abiFilters to the native template (#546)
<!-- Please provide enough information so that others can review your pull request. --> <!-- Keep pull requests small and focused on a single change. --> ### Summary In the native template `abiFilters` is missing from `externalNativeBuild` block. This means that the library would be built for every available ABI when building the application, even if the application itself is being built for a specific one. This is not that problematic (besides taking more time) when using React Native aar, but when building RN from source the core `.so` files will be built for that specific ABI. In case the library depends on a `.so` file, it would fail at the linking stage due to missing `.so` for the remaining ABIs. ### Test plan See - Expensify/App#40102 - Expensify/react-native-live-markdown#284 - https://github.com/margelo/react-native-quick-sqlite/pull/41 --------- Co-authored-by: Satyajit Sahoo <[email protected]>
1 parent 148fda0 commit c7dfe9e

File tree

1 file changed

+6
-0
lines changed
  • packages/create-react-native-library/templates/native-common/android

1 file changed

+6
-0
lines changed

packages/create-react-native-library/templates/native-common/android/build.gradle

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ buildscript {
1818
}
1919
}
2020

21+
def reactNativeArchitectures() {
22+
def value = rootProject.getProperties().get("reactNativeArchitectures")
23+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
24+
}
25+
2126
def isNewArchitectureEnabled() {
2227
return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true"
2328
}
@@ -75,6 +80,7 @@ android {
7580
externalNativeBuild {
7681
cmake {
7782
cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all"
83+
abiFilters (*reactNativeArchitectures())
7884
}
7985
}
8086
<% } -%>

0 commit comments

Comments
 (0)