Skip to content

Commit

Permalink
android: fix min sdk version (#48)
Browse files Browse the repository at this point in the history
* android: require NDK 24.x or higher

* fix: compileNativeModulesSdkVersion
  • Loading branch information
okhiroyuki authored Oct 28, 2023
1 parent 02677d0 commit 12f817f
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,12 @@ buildscript {
}
}

def _nodeMinSdkVersion = ((rootProject?.ext?.properties?.minSdkVersion) ?: 24)
def _compileNativeModulesSdkVersion = _nodeMinSdkVersion;
if (_compileNativeModulesSdkVersion<24) {
// 24 is the minimum sdk version Node is built with.
_compileNativeModulesSdkVersion=24;
}
def _nodeMinSdkVersion = 24
ext.cdvMinSdkVersion = _nodeMinSdkVersion
def _compileNativeModulesSdkVersion=_nodeMinSdkVersion;

android {
defaultConfig {
minSdkVersion _nodeMinSdkVersion
externalNativeBuild {
cmake {
cppFlags ""
Expand Down Expand Up @@ -178,7 +174,7 @@ cdvPluginPostBuildExtras += { ->

String ndk_bundle_path = android.ndkDirectory
String toolchain_path = "${ndk_bundle_path}/toolchains/llvm/prebuilt/${temp_host_tag}"
String npm_toolchain_ar = "${toolchain_path}/bin/${temp_binutils_prefix}-ar"
String npm_toolchain_ar = "${toolchain_path}/bin/llvm-ar"
String npm_toolchain_cc = "${toolchain_path}/bin/${temp_compiler_prefix}-clang"
String npm_toolchain_cxx = "${toolchain_path}/bin/${temp_compiler_prefix}-clang++"
String npm_toolchain_link = "${toolchain_path}/bin/${temp_compiler_prefix}-clang++"
Expand Down

0 comments on commit 12f817f

Please sign in to comment.