diff --git a/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java b/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java index d560f674..f09e1f04 100644 --- a/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/model/InternalProjectConfiguration.java @@ -45,6 +45,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; +import static com.gluonhq.substrate.target.AndroidTargetConfiguration.ANDROID_NDK_VERSION; + /** * This class contains all configuration info about the current project (not about the current OS/Arch/vendor etc) * @@ -272,7 +274,7 @@ public Path getAndroidSdkPath() { public Path getAndroidNdkPath() { String ndkEnv = System.getenv("ANDROID_NDK"); return (ndkEnv != null) ? Paths.get(ndkEnv) - : getAndroidSdkPath().resolve("ndk-bundle"); + : getAndroidSdkPath().resolve("ndk").resolve(ANDROID_NDK_VERSION); } /** diff --git a/src/main/java/com/gluonhq/substrate/target/AndroidTargetConfiguration.java b/src/main/java/com/gluonhq/substrate/target/AndroidTargetConfiguration.java index 934b1f9d..4198b1ec 100644 --- a/src/main/java/com/gluonhq/substrate/target/AndroidTargetConfiguration.java +++ b/src/main/java/com/gluonhq/substrate/target/AndroidTargetConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019, 2022, Gluon + * Copyright (c) 2019, 2023, Gluon * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -66,6 +66,7 @@ public class AndroidTargetConfiguration extends PosixTargetConfiguration { private static final String ANDROID_TRIPLET = new Triplet(Constants.Profile.ANDROID).toString(); private static final String ANDROID_MIN_SDK_VERSION = "21"; + public static final String ANDROID_NDK_VERSION = "25.2.9519653"; private static final List ANDROID_KEYSTORE_EXTENSIONS = List.of(".keystore", ".jks"); private static final String WL_WHOLE_ARCHIVE = "-Wl,--whole-archive"; private static final String WL_NO_WHOLE_ARCHIVE = "-Wl,--no-whole-archive"; diff --git a/src/main/java/com/gluonhq/substrate/util/FileDeps.java b/src/main/java/com/gluonhq/substrate/util/FileDeps.java index 2349d2fe..f2073fad 100644 --- a/src/main/java/com/gluonhq/substrate/util/FileDeps.java +++ b/src/main/java/com/gluonhq/substrate/util/FileDeps.java @@ -45,6 +45,8 @@ import java.util.stream.Collectors; import java.util.stream.Stream; +import static com.gluonhq.substrate.target.AndroidTargetConfiguration.ANDROID_NDK_VERSION; + public final class FileDeps { private static final String JAVA_STATIC_ZIP = "${staticjdk}-${target}-gvm-${version}.zip"; @@ -71,7 +73,7 @@ public final class FileDeps { private static final String ANDROID_KEY = "24333f8a63b6825ea9c5514f83c2829b004d1fee"; private static final String[] ANDROID_SDK_PACKAGES = { "platforms;android-33", "build-tools;33.0.2", "platform-tools", - "extras;android;m2repository", "extras;google;m2repository", "ndk;25.2.9519653" + "extras;android;m2repository", "extras;google;m2repository", "ndk;" + ANDROID_NDK_VERSION }; private static final String ARCH_SYSROOT_URL = "https://download2.gluonhq.com/substrate/sysroot/${arch}sysroot-${version}.zip";