Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest
Forum Updated to NodeBB v4.3 + New Features

Qt 6.5.3 - minSdkVersion and targetSdkVersion missing values or grayed out in AndroidManifest

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 2 Posters 1.7k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    oserrabassa
    wrote last edited by oserrabassa
    #1

    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-creator

    Qt 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?
    5d9e991b-3d8e-4d03-9df4-958ce96b8553-image.png
    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.
    9f86f207-688f-493b-b137-52cc58124d3e-image.png

    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?
    b5a4d890-be59-4529-89af-32b00fb9936b-image.png

    T 1 Reply Last reply
    0
    • O oserrabassa

      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-creator

      Qt 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?
      5d9e991b-3d8e-4d03-9df4-958ce96b8553-image.png
      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.
      9f86f207-688f-493b-b137-52cc58124d3e-image.png

      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?
      b5a4d890-be59-4529-89af-32b00fb9936b-image.png

      T Offline
      T Offline
      TheoSys
      wrote last edited by
      #2

      @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:
      Bildschirmfoto 2025-08-21 um 14.54.26.png
      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):
      Bildschirmfoto 2025-08-21 um 15.00.57.png

      A.T.

      O 1 Reply Last reply
      0
      • T TheoSys

        @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:
        Bildschirmfoto 2025-08-21 um 14.54.26.png
        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):
        Bildschirmfoto 2025-08-21 um 15.00.57.png

        A.T.

        O Offline
        O Offline
        oserrabassa
        wrote last edited by oserrabassa
        #3

        @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:
        Bildschirmfoto 2025-08-21 um 14.54.26.png

        My problem is not this. I do not have any issues in setting compileSdkVersion from the build kits.
        1d0b2218-d609-43e4-a0af-0a80cb942d52-image.png
        29a04234-ecbe-4bad-96c3-01776e3763e6-image.png
        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.
        22e5f9c8-9b9d-49d8-9e29-016ac4518f89-image.png

        1 Reply Last reply
        0
        • T Offline
          T Offline
          TheoSys
          wrote last edited by
          #4

          @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.

          O 1 Reply Last reply
          0
          • T TheoSys

            @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.

            O Offline
            O Offline
            oserrabassa
            wrote last edited by
            #5

            @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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved