From 74fe24993229d5a0f77a569959056e6f5bff5662 Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Thu, 11 Apr 2024 16:31:28 +0200 Subject: [PATCH 1/2] Add abiFilters to the native template --- .../templates/native-common/android/build.gradle | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/create-react-native-library/templates/native-common/android/build.gradle b/packages/create-react-native-library/templates/native-common/android/build.gradle index 3b6b54a93..d59825344 100644 --- a/packages/create-react-native-library/templates/native-common/android/build.gradle +++ b/packages/create-react-native-library/templates/native-common/android/build.gradle @@ -18,6 +18,11 @@ buildscript { } } +def reactNativeArchitectures() { + def value = project.getProperties().get("reactNativeArchitectures") + return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] +} + def isNewArchitectureEnabled() { return rootProject.hasProperty("newArchEnabled") && rootProject.getProperty("newArchEnabled") == "true" } @@ -75,6 +80,7 @@ android { externalNativeBuild { cmake { cppFlags "-O2 -frtti -fexceptions -Wall -fstack-protector-all" + abiFilters (*reactNativeArchitectures()) } } <% } -%> From 3e7e11ba89d25891fbd445bef50dcf553ba2fd7f Mon Sep 17 00:00:00 2001 From: Jakub Piasecki Date: Thu, 16 May 2024 12:23:15 +0200 Subject: [PATCH 2/2] Update packages/create-react-native-library/templates/native-common/android/build.gradle Co-authored-by: Satyajit Sahoo --- .../templates/native-common/android/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/create-react-native-library/templates/native-common/android/build.gradle b/packages/create-react-native-library/templates/native-common/android/build.gradle index d59825344..e0e3a6428 100644 --- a/packages/create-react-native-library/templates/native-common/android/build.gradle +++ b/packages/create-react-native-library/templates/native-common/android/build.gradle @@ -19,7 +19,7 @@ buildscript { } def reactNativeArchitectures() { - def value = project.getProperties().get("reactNativeArchitectures") + def value = rootProject.getProperties().get("reactNativeArchitectures") return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] }