From 072a9104ba8539cdf86b1a9575b08969e96c9b5c Mon Sep 17 00:00:00 2001 From: Tobias Klein Date: Thu, 26 Dec 2024 19:52:34 +0100 Subject: [PATCH] fix(android): set default ABI filters only if none are defined This is the previous behavior from the JaneaSystems branch of nodejs-mobile-cordova. This way it is still possible to override the abiFilters as a user. --- src/android/build.gradle | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/android/build.gradle b/src/android/build.gradle index d1773254..bf1ce345 100644 --- a/src/android/build.gradle +++ b/src/android/build.gradle @@ -40,9 +40,11 @@ import org.gradle.internal.os.OperatingSystem; import org.gradle.util.GradleVersion; cdvPluginPostBuildExtras += { -> - // Set it to the supported architectures. - logger.info("nodejs-mobile-cordova were set [\"armeabi-v7a\", \"arm64-v8a\", \"x86_64\"] for ABI filters."); - android.defaultConfig.ndk.abiFilters = ["armeabi-v7a", "arm64-v8a", "x86_64"] as Set; + if (android.defaultConfig.ndk.abiFilters == null) { + // No abiFilter is defined for the build. Set it to the supported architectures. + logger.info("nodejs-mobile-cordova detected no ABI filters were set. Will use [\"armeabi-v7a\", \"arm64-v8a\", \"x86_64\"] for ABI filters."); + android.defaultConfig.ndk.abiFilters = ["armeabi-v7a", "arm64-v8a", "x86_64"] as Set; + } // gzip files will cause errors with aapt. Remove them for improved npm compatibility. android.aaptOptions.ignoreAssetsPattern += ":!*.gz";