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 app doesn't run

Android app doesn't run

Scheduled Pinned Locked Moved Solved Mobile and Embedded
87 Posts 7 Posters 20.8k 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.
  • J JoeCFD
    10 Nov 2023, 20:22

    @mzimmers No, Qt installer does not do it as I remember. There is a place you can change gradle version number in the installed Qt.
    You are using Java 18? from here:
    https://docs.gradle.org/current/userguide/compatibility.html

    Even the latest Android 14(API 34) requires only Java 17. Scroll down from here:
    https://developer.android.com/build/jdks

    You can try to set
    package="org.nga.appyyy"
    if nga is your company name and appyy your project name.
    That is the format I use. I saw someone wrote org seems needed. We need to document this in the forum somewhere. We waste so much time for this kind of issues.

    M Offline
    M Offline
    mzimmers
    wrote on 10 Nov 2023, 22:24 last edited by
    #14

    @JoeCFD well, as it turns out, it doesn't appear to be related to my changing the project name -- I had an old copy of the project, and that fails in the same way. (It had been awhile since I bothered trying to load to the tablet.)

    I'm going to re-title this topic, as the current title is incorrect.

    E 1 Reply Last reply 11 Nov 2023, 13:02
    0
    • M mzimmers
      10 Nov 2023, 22:24

      @JoeCFD well, as it turns out, it doesn't appear to be related to my changing the project name -- I had an old copy of the project, and that fails in the same way. (It had been awhile since I bothered trying to load to the tablet.)

      I'm going to re-title this topic, as the current title is incorrect.

      E Offline
      E Offline
      ekkescorner
      Qt Champions 2016
      wrote on 11 Nov 2023, 13:02 last edited by
      #15

      @mzimmers what are your Qt and QtCreator versions ?
      and Android target API ?

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

      M 1 Reply Last reply 11 Nov 2023, 13:53
      0
      • E ekkescorner
        11 Nov 2023, 13:02

        @mzimmers what are your Qt and QtCreator versions ?
        and Android target API ?

        M Offline
        M Offline
        mzimmers
        wrote on 11 Nov 2023, 13:53 last edited by mzimmers 11 Nov 2023, 13:54
        #16

        @ekkescorner
        Qt 6.5.3
        Creator 11.0.3

        Not sure what an Android target API is - unless you mean arm64-v8a.

        E 1 Reply Last reply 11 Nov 2023, 14:32
        0
        • M mzimmers
          11 Nov 2023, 13:53

          @ekkescorner
          Qt 6.5.3
          Creator 11.0.3

          Not sure what an Android target API is - unless you mean arm64-v8a.

          E Offline
          E Offline
          ekkescorner
          Qt Champions 2016
          wrote on 11 Nov 2023, 14:32 last edited by ekkescorner 11 Nov 2023, 15:58
          #17

          @mzimmers arm64-v8a is the architecture - in this case arm 64bit
          in QMake:
          under Build Android APK Android Build Platform SDK is set to android-33 (Android 13), Android Build Tools are 33.0.2
          and in .pro I have set Min SDK and target SDK:
          ANDROID_MIN_SDK_VERSION = "23"
          ANDROID_TARGET_SDK_VERSION = "33"
          For me - working on macOS - I never have to install Gradle or so. it's working.
          I always do 'Create Templates' as you have done. Sometimes I had problems creating templates and 'Replace all' - have done 'replace' for each file extra.
          I'm using Qt 6.6 and QtC 11.0.2
          Have no idea how this will be with CMake. Just fighting with my last 5.15 App-port to 6.6 (QMake), so soon will enter CMake ;-)

          BTW: as @JoeCFD said: as packageName you should use your domain in reverse order together with a short app name, per ex. org.yourname.yourAppName and this must be unique. the packageName is independent from project name, per ex for a customer I'm building APKs with different packageNames like: de.theCustomer.theApp.test and de.theCustomer.theApp.prod while the project has a different name: theCustomer_theApp

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

          1 Reply Last reply
          0
          • S Offline
            S Offline
            Shahab Khan
            wrote on 8 Dec 2023, 19:12 last edited by
            #18
            This post is deleted!
            1 Reply Last reply
            0
            • M Offline
              M Offline
              mzimmers
              wrote on 26 Dec 2023, 22:27 last edited by
              #19

              Hi all -

              I need to bump this, because I really need to get this app running on Android. I created a new, minimal project, and I'm still getting the error:

              Error: Activity class {org.qtproject.example.minimal_map/org.qtproject.qt.android.bindings.QtActivity} does not exist.
              

              I'm guessing it has something to do with my manifest file, and here's where I need help. I really don't understand most of the fields in this display:
              Screenshot 2023-12-26 141909.png
              So, a few questions:

              1. the fields that look like: -- %%INSERT_APP_NAME%% --; am I supposed to replaceeverything with my own values, or do I keep the dashes and "%"?
              2. do I need to replace all of those fields?
              3. what exactly is an "activity name?" My searches haven't revealed much.

              Thanks for any assistance...

              E J 2 Replies Last reply 3 Jan 2024, 13:07
              0
              • M mzimmers
                26 Dec 2023, 22:27

                Hi all -

                I need to bump this, because I really need to get this app running on Android. I created a new, minimal project, and I'm still getting the error:

                Error: Activity class {org.qtproject.example.minimal_map/org.qtproject.qt.android.bindings.QtActivity} does not exist.
                

                I'm guessing it has something to do with my manifest file, and here's where I need help. I really don't understand most of the fields in this display:
                Screenshot 2023-12-26 141909.png
                So, a few questions:

                1. the fields that look like: -- %%INSERT_APP_NAME%% --; am I supposed to replaceeverything with my own values, or do I keep the dashes and "%"?
                2. do I need to replace all of those fields?
                3. what exactly is an "activity name?" My searches haven't revealed much.

                Thanks for any assistance...

                E Offline
                E Offline
                ekkescorner
                Qt Champions 2016
                wrote on 3 Jan 2024, 13:07 last edited by
                #20

                @mzimmers said in Android app doesn't run:

                the fields that look like: -- %%INSERT_APP_NAME%% --; am I supposed to replaceeverything with my own values, or do I keep the dashes and "%"?
                do I need to replace all of those fields?

                if you don't replace the values, then QtCreator will fill this value. After building the project, you can go to the build dir, find the manifest and open to see what vaklues QtC inserted.
                In my apps I always put my own value in, per ex. QtWS for the QtWorldSummit App.
                if you change the value, switch editor to xml source to see that Application label (https://developer.android.com/guide/topics/manifest/application-element#label) and Activity label (https://developer.android.com/guide/topics/manifest/activity-element#label) changed.

                what exactly is an "activity name?" My searches haven't revealed much.
                see above. simply search for "android manifest doc"

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

                1 Reply Last reply
                1
                • M mzimmers
                  26 Dec 2023, 22:27

                  Hi all -

                  I need to bump this, because I really need to get this app running on Android. I created a new, minimal project, and I'm still getting the error:

                  Error: Activity class {org.qtproject.example.minimal_map/org.qtproject.qt.android.bindings.QtActivity} does not exist.
                  

                  I'm guessing it has something to do with my manifest file, and here's where I need help. I really don't understand most of the fields in this display:
                  Screenshot 2023-12-26 141909.png
                  So, a few questions:

                  1. the fields that look like: -- %%INSERT_APP_NAME%% --; am I supposed to replaceeverything with my own values, or do I keep the dashes and "%"?
                  2. do I need to replace all of those fields?
                  3. what exactly is an "activity name?" My searches haven't revealed much.

                  Thanks for any assistance...

                  J Offline
                  J Offline
                  JKSH
                  Moderators
                  wrote on 5 Jan 2024, 01:30 last edited by
                  #21

                  @mzimmers said in Android app doesn't run:

                  I created a new, minimal project, and I'm still getting the error:

                  Quick sanity check: Do you get the error if create a new, minimal project and run it on Android without doing anything at all to the manifest file? In other words, just create the project and build + run it.

                  I'm guessing it has something to do with my manifest file, and here's where I need help. I really don't understand most of the fields in this display:

                  Be warned, that manifest editor is badly broken: https://bugreports.qt.io/browse/QTCREATORBUG-27119 I recommend that you don't touch it -- even the act of opening that editor is enough to corrupt the manifest file in some cases.

                  Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                  E M 2 Replies Last reply 5 Jan 2024, 08:29
                  0
                  • J JKSH
                    5 Jan 2024, 01:30

                    @mzimmers said in Android app doesn't run:

                    I created a new, minimal project, and I'm still getting the error:

                    Quick sanity check: Do you get the error if create a new, minimal project and run it on Android without doing anything at all to the manifest file? In other words, just create the project and build + run it.

                    I'm guessing it has something to do with my manifest file, and here's where I need help. I really don't understand most of the fields in this display:

                    Be warned, that manifest editor is badly broken: https://bugreports.qt.io/browse/QTCREATORBUG-27119 I recommend that you don't touch it -- even the act of opening that editor is enough to corrupt the manifest file in some cases.

                    E Offline
                    E Offline
                    ekkescorner
                    Qt Champions 2016
                    wrote on 5 Jan 2024, 08:29 last edited by
                    #22

                    @JKSH said in Android app doesn't run:

                    Be warned, that manifest editor is badly broken: https://bugreports.qt.io/browse/QTCREATORBUG-27119 I recommend that you don't touch it -- even the act of opening that editor is enough to corrupt the manifest file in some cases.

                    also have noticed that opening with Manifest Editor sometimes changes the content. But in my cases it was only a reformatting / reordering and nothing destroyed. (QtC 12.0.1)

                    BTW: I'm getting best experiences this way:

                    • Update Templates
                    • check changes (using git)
                    • add / replace with my settings
                      this way I'm always getting the newest recommended values

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

                    M 1 Reply Last reply 5 Jan 2024, 13:25
                    0
                    • E ekkescorner
                      5 Jan 2024, 08:29

                      @JKSH said in Android app doesn't run:

                      Be warned, that manifest editor is badly broken: https://bugreports.qt.io/browse/QTCREATORBUG-27119 I recommend that you don't touch it -- even the act of opening that editor is enough to corrupt the manifest file in some cases.

                      also have noticed that opening with Manifest Editor sometimes changes the content. But in my cases it was only a reformatting / reordering and nothing destroyed. (QtC 12.0.1)

                      BTW: I'm getting best experiences this way:

                      • Update Templates
                      • check changes (using git)
                      • add / replace with my settings
                        this way I'm always getting the newest recommended values
                      M Offline
                      M Offline
                      mzimmers
                      wrote on 5 Jan 2024, 13:25 last edited by
                      #23

                      @ekkescorner said in Android app doesn't run:

                      check changes (using git)

                      Could you elaborate on this? Changes to what, exactly?

                      E 1 Reply Last reply 5 Jan 2024, 14:11
                      0
                      • M mzimmers
                        5 Jan 2024, 13:25

                        @ekkescorner said in Android app doesn't run:

                        check changes (using git)

                        Could you elaborate on this? Changes to what, exactly?

                        E Offline
                        E Offline
                        ekkescorner
                        Qt Champions 2016
                        wrote on 5 Jan 2024, 14:11 last edited by
                        #24

                        @mzimmers see here what I did while updating from 5.15 to 6.6:
                        https://t1p.de/ekkeAndroidTemplates66
                        this will give you the idea how I'm doing this

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

                        M 1 Reply Last reply 5 Jan 2024, 15:28
                        1
                        • J JKSH
                          5 Jan 2024, 01:30

                          @mzimmers said in Android app doesn't run:

                          I created a new, minimal project, and I'm still getting the error:

                          Quick sanity check: Do you get the error if create a new, minimal project and run it on Android without doing anything at all to the manifest file? In other words, just create the project and build + run it.

                          I'm guessing it has something to do with my manifest file, and here's where I need help. I really don't understand most of the fields in this display:

                          Be warned, that manifest editor is badly broken: https://bugreports.qt.io/browse/QTCREATORBUG-27119 I recommend that you don't touch it -- even the act of opening that editor is enough to corrupt the manifest file in some cases.

                          M Offline
                          M Offline
                          mzimmers
                          wrote on 5 Jan 2024, 15:27 last edited by
                          #25

                          @JKSH thanks for the warning about the manifest editor -- it looks like TQC has painted itself into a corner on this one.

                          I was going to try your suggestion, but now I have a different problem: my Android device shows as "disconnected" and I can't figure out what to do about this.

                          E J 2 Replies Last reply 5 Jan 2024, 15:49
                          0
                          • E ekkescorner
                            5 Jan 2024, 14:11

                            @mzimmers see here what I did while updating from 5.15 to 6.6:
                            https://t1p.de/ekkeAndroidTemplates66
                            this will give you the idea how I'm doing this

                            M Offline
                            M Offline
                            mzimmers
                            wrote on 5 Jan 2024, 15:28 last edited by
                            #26

                            @ekkescorner that's a great page. I'm using 6.5.3; do you think your suggestions will work with this version?

                            E 1 Reply Last reply 5 Jan 2024, 15:48
                            0
                            • M mzimmers
                              5 Jan 2024, 15:28

                              @ekkescorner that's a great page. I'm using 6.5.3; do you think your suggestions will work with this version?

                              E Offline
                              E Offline
                              ekkescorner
                              Qt Champions 2016
                              wrote on 5 Jan 2024, 15:48 last edited by
                              #27

                              @mzimmers will be similar, but not the same. per ex. the Qt FileProvider only exists in 6.6+

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

                              1 Reply Last reply
                              0
                              • M mzimmers
                                5 Jan 2024, 15:27

                                @JKSH thanks for the warning about the manifest editor -- it looks like TQC has painted itself into a corner on this one.

                                I was going to try your suggestion, but now I have a different problem: my Android device shows as "disconnected" and I can't figure out what to do about this.

                                E Offline
                                E Offline
                                ekkescorner
                                Qt Champions 2016
                                wrote on 5 Jan 2024, 15:49 last edited by
                                #28

                                @mzimmers said in Android app doesn't run:

                                my Android device shows as "disconnected"

                                connected via wifi or via usb cable ?

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

                                M 1 Reply Last reply 5 Jan 2024, 15:50
                                0
                                • M mzimmers
                                  5 Jan 2024, 15:27

                                  @JKSH thanks for the warning about the manifest editor -- it looks like TQC has painted itself into a corner on this one.

                                  I was going to try your suggestion, but now I have a different problem: my Android device shows as "disconnected" and I can't figure out what to do about this.

                                  J Offline
                                  J Offline
                                  JoeCFD
                                  wrote on 5 Jan 2024, 15:50 last edited by JoeCFD 1 May 2024, 15:51
                                  #29

                                  @mzimmers Click Manage Kits->Devices
                                  select your device in Device combobox since your device may not be the default one.
                                  Then click Debug above Run button and select your connected device.

                                  M 1 Reply Last reply 5 Jan 2024, 15:56
                                  0
                                  • E ekkescorner
                                    5 Jan 2024, 15:49

                                    @mzimmers said in Android app doesn't run:

                                    my Android device shows as "disconnected"

                                    connected via wifi or via usb cable ?

                                    M Offline
                                    M Offline
                                    mzimmers
                                    wrote on 5 Jan 2024, 15:50 last edited by
                                    #30

                                    @ekkescorner USB cable. I deleted that device, and am trying to create a new one, but it keeps trying to make an emulator, not a "real" Android device.

                                    E 1 Reply Last reply 5 Jan 2024, 15:55
                                    0
                                    • M mzimmers
                                      5 Jan 2024, 15:50

                                      @ekkescorner USB cable. I deleted that device, and am trying to create a new one, but it keeps trying to make an emulator, not a "real" Android device.

                                      E Offline
                                      E Offline
                                      ekkescorner
                                      Qt Champions 2016
                                      wrote on 5 Jan 2024, 15:55 last edited by
                                      #31

                                      @mzimmers creating devices is for emulators. to connect via USB see https://t1p.de/ekkeManageDevices

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

                                      M 1 Reply Last reply 5 Jan 2024, 15:58
                                      1
                                      • J JoeCFD
                                        5 Jan 2024, 15:50

                                        @mzimmers Click Manage Kits->Devices
                                        select your device in Device combobox since your device may not be the default one.
                                        Then click Debug above Run button and select your connected device.

                                        M Offline
                                        M Offline
                                        mzimmers
                                        wrote on 5 Jan 2024, 15:56 last edited by
                                        #32

                                        @JoeCFD interesting -- I thought I had deleted that device, but it still shows up (and appears to be selected):
                                        Screenshot 2024-01-05 075223.png
                                        I'm not sure what you are referring to with "Debug above Run button." I'm only trying to build a release version.

                                        1 Reply Last reply
                                        0
                                        • E ekkescorner
                                          5 Jan 2024, 15:55

                                          @mzimmers creating devices is for emulators. to connect via USB see https://t1p.de/ekkeManageDevices

                                          M Offline
                                          M Offline
                                          mzimmers
                                          wrote on 5 Jan 2024, 15:58 last edited by
                                          #33

                                          @ekkescorner oh, OK. I didn't realize that.

                                          So...any idea why my device is showing as disconnected?

                                          J 1 Reply Last reply 5 Jan 2024, 15:59
                                          0

                                          • Login

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