aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexey Edelev <alexey.edelev@qt.io>2022-12-21 16:46:11 +0100
committerAlexey Edelev <alexey.edelev@qt.io>2022-12-23 17:10:13 +0000
commit803fb4ce77d5b75a9cb542e6bd160f5396269d65 (patch)
tree18b4e4bfd8deab441e0a63db5e98605bcf17d123
parent01a4f47781686a497745db0ffd0f4d65daff0ff2 (diff)
Replace ANDROID_NATIVE_API_LEVEL with ANDROID_PLATFORM
ANDROID_NATIVE_API_LEVEL is not handled by the android toolchain files starting the NDK version r23b. We should set ANDROID_PLATFORM instead, to specify the NDK platform version, that exists in all NDK versions supported by Qt. Also the ANDROID_PLATFORM variable expects the 'android-xx' format as a value, so avoid cutting the 'android-' prefix when adding the value to the CMake configure string. Fixes: QTCREATORBUG-28624 Change-Id: Idd4ba472e46982162e5ad74e9fc6868e50e3b434 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
-rw-r--r--src/plugins/android/androidbuildapkstep.cpp2
-rw-r--r--src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp
index 918a4e3977..4d03613bed 100644
--- a/src/plugins/android/androidbuildapkstep.cpp
+++ b/src/plugins/android/androidbuildapkstep.cpp
@@ -917,7 +917,7 @@ QVariant AndroidBuildApkStep::data(Utils::Id id) const
if (id == Constants::AndroidNdkPlatform) {
if (auto qtVersion = QtKitAspect::qtVersion(kit()))
return AndroidConfigurations::currentConfig()
- .bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion).mid(8);
+ .bestNdkPlatformMatch(AndroidManager::minimumSDK(target()), qtVersion);
return {};
}
if (id == Constants::NdkLocation) {
diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
index 4b6ab55d4d..1823462382 100644
--- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
+++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp
@@ -1477,7 +1477,7 @@ CMakeBuildConfiguration::CMakeBuildConfiguration(Target *target, Id id)
if (DeviceTypeKitAspect::deviceTypeId(k) == Android::Constants::ANDROID_DEVICE_TYPE) {
buildSteps()->appendStep(Android::Constants::ANDROID_BUILD_APK_ID);
const auto &bs = buildSteps()->steps().constLast();
- cmd.addArg("-DANDROID_NATIVE_API_LEVEL:STRING="
+ cmd.addArg("-DANDROID_PLATFORM:STRING="
+ bs->data(Android::Constants::AndroidNdkPlatform).toString());
auto ndkLocation = bs->data(Android::Constants::NdkLocation).value<FilePath>();
cmd.addArg("-DANDROID_NDK:PATH=" + ndkLocation.path());