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. how to change API level ?
QtWS25 Last Chance

how to change API level ?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
6 Posts 6 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.
  • 0 Offline
    0 Offline
    0xNull
    wrote on 30 Jul 2024, 20:05 last edited by
    #1

    hi there im running an app using android 9 on my device but looks like compiler always take api level 35 that doesn't match with my current api level and generate this error:

    FAILURE: Build failed with an exception.

    • What went wrong:
      Execution failed for task ':processDebugResources'.

    A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
    Android resource linking failed
    aapt2 E 07-30 14:53:26 50028 50028 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
    aapt2 E 07-30 14:53:26 50028 50028 ApkAssets.cpp:149] Failed to load resources table in APK '/home/machine/Android/Sdk/platforms/android-35-2/android.jar'.
    error: failed to load include path /home/machine/Android/Sdk/platforms/android-35-2/android.jar.

    so... again... im using android-9 on my device idk why is trying to use android 35. android qt 6.7.0 java 17 open jdk and ndk 21.3.65... is there a way to change api level instead of android 35.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      Axel Spoerl
      Moderators
      wrote on 1 Aug 2024, 08:42 last edited by
      #2

      You’ll do that in the Android device settings in n Qt Creator’s preferences.
      Here is a video tutorial.

      Software Engineer
      The Qt Company, Oslo

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Erulission
        wrote on 8 Aug 2024, 19:57 last edited by
        #3

        You need to uninstall android platform 35 from sdk manager. I struggled with it many times - for some reason during the build always the newest version from your SDK is taken, no matter what settings you have in the project.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          michjans
          wrote on 9 Aug 2024, 10:26 last edited by
          #4

          Hi,
          I have a similar problem as @0xNull wrote. Also want target platform to be Android 9, so API level 28, but am also getting build failures. I followed the video tutorial, but there I don´t see explained how you can build for a lower API level (unless I missed something).

          When I set Android build-tools version to 28.0 and Android build platform SDK to 28 and do a rebuild, I get e.g.

          FAILURE: Build failed with an exception.
          
          * What went wrong:
          Execution failed for task ':checkDebugAarMetadata'.
          > A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
             > 6 issues were found when checking AAR metadata:
               
                 1.  Dependency 'androidx.core:core:1.13.1' requires libraries and applications that
                     depend on it to compile against version 34 or later of the
                     Android APIs.
               
                     : is currently compiled against android-28.
               
                     Also, the maximum recommended compile SDK version for Android Gradle
                     plugin 7.4.1 is 33.
          ...
          ...
          

          I also tried the suggestion written by @Erulission, but if I remove the highest SDK platform (34 in my case), the SDK manager complains that "Android SDK installation is missing necessary packages". However I have installed the SDK platform 28 (Android 9.0).

          And according to this page: Qt 6.7 for Android page, the minimum allowed API level should be able to support 26.

          1 Reply Last reply
          0
          • 1 Offline
            1 Offline
            1XU7
            wrote on 29 Nov 2024, 21:34 last edited by
            #5

            Android is crazy man.... is crazy... look... i use Unreal Engine and it setups Android SDK too.. that was enought to take down Qt Android SDK configuration... i can not understand why Android has so many versions of versions, why don't they have some universal platform or something like that..

            i have the table error too.. toggled off API 35.. but still Qt tries to use it..
            i guess i will make a clean (another) Windows install and try again..

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Michel de Boer
              wrote on 30 Dec 2024, 21:42 last edited by
              #6

              Have you set the target SDK level and build tools?
              I have this for my app targeting API level 34

              set_target_properties(appskywalker PROPERTIES
                  QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
                  QT_ANDROID_TARGET_SDK_VERSION 34
                  QT_ANDROID_SDK_BUILD_TOOLS_REVISION 34.0.0
                  QT_ANDROID_VERSION_NAME ${APP_VERSION}
                  QT_ANDROID_VERSION_CODE ${VERSION_CODE})
              
              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