From 5dff920177220ae5f4e37c662c63c27ebf696c83 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 31 Mar 2022 11:11:40 -0700 Subject: [PATCH] Template: Specify abiFilters if enableSeparateBuildPerCPUArchitecture is not set. Summary: As users can toggle `enableSeparateBuildPerCPUArchitecture` to create a split APK, once that is off, the `-PreactNativeArchitecture` is not correctly considered when building the local module. This will make sure that, if users have `enableSeparateBuildPerCPUArchitecture` set to `false`, their app is building the local `app_modules` only for the requested architectures. Practically, users invoking with `--active-arch-only` might experience a build failure if they have a fully clean environment (would be forced to do a full build before using `--active-arch-only`). This addresses this scenario. Changelog: [Android] [Fixed] - Template: Specify abiFilters if enableSeparateBuildPerCPUArchitecture is not set. Reviewed By: ShikaSD Differential Revision: D35250700 fbshipit-source-id: 4e555888636cf182495fab2b4a562d93a70b9e66 --- template/android/app/build.gradle | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/template/android/app/build.gradle b/template/android/app/build.gradle index 2c96211af948fd..5e68d78dd8435d 100644 --- a/template/android/app/build.gradle +++ b/template/android/app/build.gradle @@ -159,6 +159,11 @@ android { targets "helloworld_appmodules" } } + if (!enableSeparateBuildPerCPUArchitecture) { + ndk { + abiFilters (*reactNativeArchitectures()) + } + } } }