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. Android API - 35 issues in Qt 5.15.2
Forum Updated to NodeBB v4.3 + New Features

Android API - 35 issues in Qt 5.15.2

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
11 Posts 3 Posters 406 Views 1 Watching
  • 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.
  • S Offline
    S Offline
    Stamp_it
    wrote last edited by
    #1

    This is required as per Google Play store policy to Update your target API level by August 31, 2025 to API level 35 or above. To update to the API level 35, I set ANDROID_TARGET_SDK_VERSION = 35 in my pro file in qt 5.15.2 - Android and compiled and built successfully and also uploaded to play store successfully.
    But when this App is downloaded to Android- 15 devices, the App opens but its top tool bar is clipped.
    The same app when installed on Android-14 devices works fine.
    Does anybody facing the same issue and found a solution?

    Thanks in advance.

    1 Reply Last reply
    0
    • ekkescornerE Offline
      ekkescornerE Offline
      ekkescorner
      Qt Champions 2016
      wrote last edited by
      #2

      This is a change by Google. Apps with API Level 35 running on Android 15 devices now are always edge-to-edge and so your toolbar is clipped.
      https://developer.android.com/develop/ui/views/layout/edge-to-edge
      starting with Qt 6.9, Qt provides Safe Areas:
      https://www.qt.io/blog/expanded-client-areas-and-safe-areas-in-qt-6.9
      on Qt 5.15 you can use MobileUI:
      https://github.com/emericg/MobileUI
      ...and you're in luck, because you can delay it until API 36:
      try out adding this in to your manifest:
      <application
      android:windowOptOutEdgeToEdgeEnforcement="true">
      </application>
      see also https://www.droidcon.com/2024/09/20/🚨-google-secretly-adds-opt-out-api-for-android-15s-edge-to-edge-behaviour-🚨/
      and discussions at Qt Discord Server: https://discord.com/channels/457523061650882570/1017293621063602186/1392839200574799923
      good luck

      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
      5.15 --> 6.9 https://t1p.de/ekkeChecklist
      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

      1 Reply Last reply
      2
      • S Offline
        S Offline
        Stamp_it
        wrote last edited by
        #3

        Thanks Ekkehard Gentz, I will check with this and let you know the results.

        ekkescornerE 1 Reply Last reply
        0
        • S Offline
          S Offline
          Stamp_it
          wrote last edited by
          #4

          Hi Ekkehard Gentz.
          Below solution didn't work
          <application
          android:windowOptOutEdgeToEdgeEnforcement="true">
          </application>

          Below is the Error-

          ---\android-build\build\intermediates\packaged_manifests\release\AndroidManifest.xml:81: error: attribute android:windowOptOutEdgeToEdgeEnforcement not found.
          error: failed processing manifest.

          • Try:

          Run with --stacktrace option to get the stack trace.
          Run with --debug option to get more log output.
          Run with --scan to get full insights.
          ==============================================================================

          2: Task failed with an exception.

          • What went wrong:
            java.lang.StackOverflowError (no error message)

          • Try:

          Run with --stacktrace option to get the stack trace.
          Run with --debug option to get more log output.
          Run with --scan to get full insights.
          ==============================================================================

          1 Reply Last reply
          0
          • S Stamp_it

            Thanks Ekkehard Gentz, I will check with this and let you know the results.

            ekkescornerE Offline
            ekkescornerE Offline
            ekkescorner
            Qt Champions 2016
            wrote last edited by ekkescorner
            #5

            @Stamp_it thx testing this.
            so it seems you should try the other way by @bchimp as discussed at Qt Discord Server:
            in your android templates directory under res/values/themes.xml you put this

            <resources xmlns:tools="http://schemas.android.com/tools">
              <style name="Theme.rando" parent="android:Theme.DeviceDefault.DayNight">
                <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
              </style>
            </resources>
            

            obviously change the style name to whatever you are using. then in AndroidManifest in the "application" part, add this:

            android:theme="@style/Theme.rando"
            

            have not tried by myself

            ekke ... Qt Champion 2016 | 2024 ... mobile business apps
            5.15 --> 6.9 https://t1p.de/ekkeChecklist
            QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

            S 1 Reply Last reply
            0
            • ekkescornerE ekkescorner

              @Stamp_it thx testing this.
              so it seems you should try the other way by @bchimp as discussed at Qt Discord Server:
              in your android templates directory under res/values/themes.xml you put this

              <resources xmlns:tools="http://schemas.android.com/tools">
                <style name="Theme.rando" parent="android:Theme.DeviceDefault.DayNight">
                  <item name="android:windowOptOutEdgeToEdgeEnforcement">true</item>
                </style>
              </resources>
              

              obviously change the style name to whatever you are using. then in AndroidManifest in the "application" part, add this:

              android:theme="@style/Theme.rando"
              

              have not tried by myself

              S Offline
              S Offline
              Stamp_it
              wrote last edited by
              #6

              @ekkescorner Ok, Thanks for replying, I will check this out.

              ekkescornerE 1 Reply Last reply
              0
              • S Stamp_it

                @ekkescorner Ok, Thanks for replying, I will check this out.

                ekkescornerE Offline
                ekkescornerE Offline
                ekkescorner
                Qt Champions 2016
                wrote last edited by
                #7

                @Stamp_it if it also doesn't work, then probably because you need newer templates as used by Qt 6 ?
                then you should consider to use MobileUI, which is working on Qt 5.15 and Qt 6.

                ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                5.15 --> 6.9 https://t1p.de/ekkeChecklist
                QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                S 1 Reply Last reply
                0
                • ekkescornerE ekkescorner

                  @Stamp_it if it also doesn't work, then probably because you need newer templates as used by Qt 6 ?
                  then you should consider to use MobileUI, which is working on Qt 5.15 and Qt 6.

                  S Offline
                  S Offline
                  Stamp_it
                  wrote last edited by
                  #8

                  @ekkescorner Thank for replying.
                  Now I am working in Qt6.6.3, With Android -35, Built the application Successfully, But on android device it shows only a white blank screen with the Name of the application at the top

                  jsulmJ 1 Reply Last reply
                  0
                  • S Stamp_it

                    @ekkescorner Thank for replying.
                    Now I am working in Qt6.6.3, With Android -35, Built the application Successfully, But on android device it shows only a white blank screen with the Name of the application at the top

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote last edited by
                    #9

                    @Stamp_it You should try with latest Qt version, which is 6.9.1

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • ekkescornerE Offline
                      ekkescornerE Offline
                      ekkescorner
                      Qt Champions 2016
                      wrote last edited by
                      #10

                      @Stamp_it would also recommend to use 6.9.1

                      ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                      5.15 --> 6.9 https://t1p.de/ekkeChecklist
                      QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                      1 Reply Last reply
                      0
                      • ekkescornerE Offline
                        ekkescornerE Offline
                        ekkescorner
                        Qt Champions 2016
                        wrote last edited by
                        #11

                        And here's what Qt says, if you want to opt-out from Android-35 edge-to-edge:
                        you have to add styles.xml and add in Manifest... activity... android:theme="@style/NormalTheme"
                        see the details here:
                        https://codereview.qt-project.org/c/qt/qtbase/+/630376

                        ekke ... Qt Champion 2016 | 2024 ... mobile business apps
                        5.15 --> 6.9 https://t1p.de/ekkeChecklist
                        QMake --> CMake https://t1p.de/ekkeCMakeMobileApps

                        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