Skip to content

Commit

Permalink
fix(android): set default ABI filters only if none are defined
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tobias-klein committed Dec 26, 2024
1 parent 62f8da1 commit 072a910
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>;
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<String>;
}

// gzip files will cause errors with aapt. Remove them for improved npm compatibility.
android.aaptOptions.ignoreAssetsPattern += ":!*.gz";
Expand Down

0 comments on commit 072a910

Please sign in to comment.