Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest
-
Apparently, this is an issue that has already been happening for a while.
https://forum.qt.io/topic/148228/how-to-increase-api-to-33-on-mobile-application
https://forum.qt.io/topic/149010/how-to-select-android-target-api-level
https://forum.qt.io/topic/150354/cannot-select-api-33-for-android-target-sdk-in-qt-creatorQt 6.5.3 officially supports Android API levels from 26 to 35.
Why is then the highest Android API value displayed 31 and not 35?
As others have reported, if you try to manually add the SDK versions to the file, they get deleted.
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34"/>
Sometimes, the options may even disable themselves after being automatically deleted.
As a workaround, because this project does not have a build.gradle and I am not planning to add one. You can set those values in CMake.
set_target_properties( androidnotifier PROPERTIES QT_ANDROID_MIN_SDK_VERSION 26 QT_ANDROID_TARGET_SDK_VERSION 34 )
I have tested and verified that this method indeed works and updates the default targetSdkVersion of 31 to whatever value you chose in CMake.
Log.d("MyTag", "targetSdkVersion: " + activity.getApplicationInfo().targetSdkVersion);
The remaining thing is...
Am I doing something wrong?
Or is this a Qt bug?
-
Apparently, this is an issue that has already been happening for a while.
https://forum.qt.io/topic/148228/how-to-increase-api-to-33-on-mobile-application
https://forum.qt.io/topic/149010/how-to-select-android-target-api-level
https://forum.qt.io/topic/150354/cannot-select-api-33-for-android-target-sdk-in-qt-creatorQt 6.5.3 officially supports Android API levels from 26 to 35.
Why is then the highest Android API value displayed 31 and not 35?
As others have reported, if you try to manually add the SDK versions to the file, they get deleted.
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="34"/>
Sometimes, the options may even disable themselves after being automatically deleted.
As a workaround, because this project does not have a build.gradle and I am not planning to add one. You can set those values in CMake.
set_target_properties( androidnotifier PROPERTIES QT_ANDROID_MIN_SDK_VERSION 26 QT_ANDROID_TARGET_SDK_VERSION 34 )
I have tested and verified that this method indeed works and updates the default targetSdkVersion of 31 to whatever value you chose in CMake.
Log.d("MyTag", "targetSdkVersion: " + activity.getApplicationInfo().targetSdkVersion);
The remaining thing is...
Am I doing something wrong?
Or is this a Qt bug?
@oserrabassa said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
Why is then the highest Android API value displayed 31 and not 35?
As long as you have installed the Android versions, you can see them in QtCreator:
Hint: Install the Android SDK over QtCreator and not over Android Studio.@oserrabassa said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
The remaining thing is...
Am I doing something wrong?
Or is this a Qt bug?I'm not sure what you mean. If you think the java version is wrong, then I can asure you that version 17 is correct. This is the Java on my Mac (have the same Java version on my Linux box):
A.T.
-
@oserrabassa said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
Why is then the highest Android API value displayed 31 and not 35?
As long as you have installed the Android versions, you can see them in QtCreator:
Hint: Install the Android SDK over QtCreator and not over Android Studio.@oserrabassa said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
The remaining thing is...
Am I doing something wrong?
Or is this a Qt bug?I'm not sure what you mean. If you think the java version is wrong, then I can asure you that version 17 is correct. This is the Java on my Mac (have the same Java version on my Linux box):
A.T.
@TheoSys said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
As long as you have installed the Android versions, you can see them in QtCreator:
My problem is not this. I do not have any issues in setting compileSdkVersion from the build kits.
My problem is that in the AndroidManifest.xml file, for whatever reason, I cannot see any API level after 31 for neither minSdkVersion and targetSdkVersion.
-
@oserrabassa said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
My problem is that in the AndroidManifest.xml file, for whatever reason, I cannot see any API level after 31 for neither minSdkVersion and targetSdkVersion.
This is because putting the SDK version into the manifest is deprecated. You'll get an error (or at least a warning) if you do so. Instead this is part of the file
build.cradle
. Even if you don't create this file QtCreator will do it for you. There you'll find the lines:compileSdkVersion androidCompileSdkVersion buildToolsVersion androidBuildToolsVersion ndkVersion androidNdkVersion
In your directory where QtCreator compiles everything you'll find a path similar to this:
Android_Qt_6_5_3_Clang_arm64_v8a-Debug/android-build
There you'll find the mainifest as well as a
build.cradle
.A.T.
-
@oserrabassa said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
My problem is that in the AndroidManifest.xml file, for whatever reason, I cannot see any API level after 31 for neither minSdkVersion and targetSdkVersion.
This is because putting the SDK version into the manifest is deprecated. You'll get an error (or at least a warning) if you do so. Instead this is part of the file
build.cradle
. Even if you don't create this file QtCreator will do it for you. There you'll find the lines:compileSdkVersion androidCompileSdkVersion buildToolsVersion androidBuildToolsVersion ndkVersion androidNdkVersion
In your directory where QtCreator compiles everything you'll find a path similar to this:
Android_Qt_6_5_3_Clang_arm64_v8a-Debug/android-build
There you'll find the mainifest as well as a
build.cradle
.A.T.
@TheoSys said in Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest:
This is because putting the SDK version into the manifest is deprecated.
Where did you find this information? I tried searching both Qt documentation and Android documentation and I have not been able to find that this approach is deprecated. Also, this neither explains why some Android API levels are not listed.