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.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.
  • mzimmersM Offline
    mzimmersM Offline
    mzimmers
    wrote on last edited by mzimmers
    #1

    Hi all -

    The Android build for my app, which used to work, now gives me an error when I try to run it:

    Activity Manager threw the error: Error type 3
    Error: Activity class {xxx.demo/org.qtproject.qt.android.bindings.QtActivity} does not exist
    

    I suspect this problem has to do with this line in my android/AndroidManifest.xml file:

    <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx.demo" android:installLocation="auto" android:versionCode="1" android:versionName="1.0.2">
    

    I originally thought this was due to a project renaming, but I now know that not to be the case. Anyone have any ideas?

    Thanks...

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

      don't know what's wrong
      seems you have built with android-35
      dont know if this works with 6.5
      have no experiences with 6.5 - started my Qt 6 development with 6.6
      you can try to change this to 33, what's supported by 6.5

      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
      • mzimmersM mzimmers

        Hi all -

        The Android build for my app, which used to work, now gives me an error when I try to run it:

        Activity Manager threw the error: Error type 3
        Error: Activity class {xxx.demo/org.qtproject.qt.android.bindings.QtActivity} does not exist
        

        I suspect this problem has to do with this line in my android/AndroidManifest.xml file:

        <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="xxx.demo" android:installLocation="auto" android:versionCode="1" android:versionName="1.0.2">
        

        I originally thought this was due to a project renaming, but I now know that not to be the case. Anyone have any ideas?

        Thanks...

        JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #2

        @mzimmers did you uninstall the old installation?
        I have something like
        org.companyname.projectshortname
        But it is only a package name without full project name in it. Therefore, I do not think project name change affects it.

        mzimmersM 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @mzimmers did you uninstall the old installation?
          I have something like
          org.companyname.projectshortname
          But it is only a package name without full project name in it. Therefore, I do not think project name change affects it.

          mzimmersM Offline
          mzimmersM Offline
          mzimmers
          wrote on last edited by
          #3

          @JoeCFD yeah, I did uninstall the old application.

          ekkescornerE 1 Reply Last reply
          0
          • mzimmersM mzimmers

            @JoeCFD yeah, I did uninstall the old application.

            ekkescornerE Offline
            ekkescornerE Offline
            ekkescorner
            Qt Champions 2016
            wrote on last edited by
            #4

            @mzimmers probably, you also have deleted your build dir ?
            and uninstalled old app and rebooted android device ?

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

            mzimmersM 1 Reply Last reply
            0
            • ekkescornerE ekkescorner

              @mzimmers probably, you also have deleted your build dir ?
              and uninstalled old app and rebooted android device ?

              mzimmersM Offline
              mzimmersM Offline
              mzimmers
              wrote on last edited by mzimmers
              #5

              @ekkescorner I did delete my build directory, and uninstalled the old version of the app. I didn't reboot my device, but I can do that. I'm not sure that will help, though, as I believe this error is occurring before Creator attempts to communicate with my tablet.

              EDIT:

              I restarted my tablet, and get the same error.
              Doesn't this appear that it has something to do with the entry in the manifest file? Or...should that get regenerated automatically?

              ekkescornerE JoeCFDJ 2 Replies Last reply
              0
              • mzimmersM mzimmers

                @ekkescorner I did delete my build directory, and uninstalled the old version of the app. I didn't reboot my device, but I can do that. I'm not sure that will help, though, as I believe this error is occurring before Creator attempts to communicate with my tablet.

                EDIT:

                I restarted my tablet, and get the same error.
                Doesn't this appear that it has something to do with the entry in the manifest file? Or...should that get regenerated automatically?

                ekkescornerE Offline
                ekkescornerE Offline
                ekkescorner
                Qt Champions 2016
                wrote on last edited by
                #6

                @mzimmers have no idea. you're using the default QtActivity.
                the packageName must be unique for your app and will be used as applicationId
                should be all ok with your app
                curious
                BTW: have only did such things (renaming) with QMake yet

                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
                • mzimmersM mzimmers

                  @ekkescorner I did delete my build directory, and uninstalled the old version of the app. I didn't reboot my device, but I can do that. I'm not sure that will help, though, as I believe this error is occurring before Creator attempts to communicate with my tablet.

                  EDIT:

                  I restarted my tablet, and get the same error.
                  Doesn't this appear that it has something to do with the entry in the manifest file? Or...should that get regenerated automatically?

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by
                  #7

                  @mzimmers Can you check your java code path if it starts with your project name under android/src?

                  mzimmersM 1 Reply Last reply
                  0
                  • JoeCFDJ JoeCFD

                    @mzimmers Can you check your java code path if it starts with your project name under android/src?

                    mzimmersM Offline
                    mzimmersM Offline
                    mzimmers
                    wrote on last edited by
                    #8

                    @JoeCFD I don't have a folder android/src in my project.

                    JoeCFDJ 1 Reply Last reply
                    0
                    • mzimmersM mzimmers

                      @JoeCFD I don't have a folder android/src in my project.

                      JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on last edited by
                      #9

                      @mzimmers do you have any own Java code?

                      mzimmersM 1 Reply Last reply
                      0
                      • JoeCFDJ JoeCFD

                        @mzimmers do you have any own Java code?

                        mzimmersM Offline
                        mzimmersM Offline
                        mzimmers
                        wrote on last edited by
                        #10

                        @JoeCFD there's no Java code in my project source, if that's what you mean.

                        JoeCFDJ 1 Reply Last reply
                        0
                        • mzimmersM mzimmers

                          @JoeCFD there's no Java code in my project source, if that's what you mean.

                          JoeCFDJ Offline
                          JoeCFDJ Offline
                          JoeCFD
                          wrote on last edited by
                          #11

                          @mzimmers OK, you do not have any java class in your project. Look through the whole project for your old project name.

                          mzimmersM 1 Reply Last reply
                          0
                          • JoeCFDJ JoeCFD

                            @mzimmers OK, you do not have any java class in your project. Look through the whole project for your old project name.

                            mzimmersM Offline
                            mzimmersM Offline
                            mzimmers
                            wrote on last edited by mzimmers
                            #12

                            @JoeCFD can't find a thing.

                            I regenerated the templates, and now am getting a build error:

                            > Failed to apply plugin 'com.android.internal.version-check'.
                               > Minimum supported Gradle version is 7.5. Current version is 7.4.2.
                            

                            Didn't Gradle get installed for me when I chose the Android option in the Qt installer? I'm wondering how I should go about updating it.

                            EDIT: apparently changing this line:

                            distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
                            

                            in the gradle-wrapper.properties resolved that issue. I copied back my manifest file, and am back to the original issue:

                            Activity Manager threw the error: Error type 3
                            Error: Activity class {nga.demo/org.qtproject.qt.android.bindings.QtActivity} does not exist.
                            

                            So, I'm back to my original question: what should I change this line to?

                            <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="nga.demo" android:installLocation="auto" android:versionCode="1" android:versionName="1.0.2">
                            
                            JoeCFDJ 1 Reply Last reply
                            0
                            • mzimmersM mzimmers

                              @JoeCFD can't find a thing.

                              I regenerated the templates, and now am getting a build error:

                              > Failed to apply plugin 'com.android.internal.version-check'.
                                 > Minimum supported Gradle version is 7.5. Current version is 7.4.2.
                              

                              Didn't Gradle get installed for me when I chose the Android option in the Qt installer? I'm wondering how I should go about updating it.

                              EDIT: apparently changing this line:

                              distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
                              

                              in the gradle-wrapper.properties resolved that issue. I copied back my manifest file, and am back to the original issue:

                              Activity Manager threw the error: Error type 3
                              Error: Activity class {nga.demo/org.qtproject.qt.android.bindings.QtActivity} does not exist.
                              

                              So, I'm back to my original question: what should I change this line to?

                              <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="nga.demo" android:installLocation="auto" android:versionCode="1" android:versionName="1.0.2">
                              
                              JoeCFDJ Offline
                              JoeCFDJ Offline
                              JoeCFD
                              wrote on last edited by JoeCFD
                              #13

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

                              mzimmersM 1 Reply Last reply
                              0
                              • JoeCFDJ JoeCFD

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

                                mzimmersM Offline
                                mzimmersM Offline
                                mzimmers
                                wrote on 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.

                                ekkescornerE 1 Reply Last reply
                                0
                                • mzimmersM mzimmers

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

                                  ekkescornerE Offline
                                  ekkescornerE Offline
                                  ekkescorner
                                  Qt Champions 2016
                                  wrote on 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

                                  mzimmersM 1 Reply Last reply
                                  0
                                  • ekkescornerE ekkescorner

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

                                    mzimmersM Offline
                                    mzimmersM Offline
                                    mzimmers
                                    wrote on last edited by mzimmers
                                    #16

                                    @ekkescorner
                                    Qt 6.5.3
                                    Creator 11.0.3

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

                                    ekkescornerE 1 Reply Last reply
                                    0
                                    • mzimmersM mzimmers

                                      @ekkescorner
                                      Qt 6.5.3
                                      Creator 11.0.3

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

                                      ekkescornerE Offline
                                      ekkescornerE Offline
                                      ekkescorner
                                      Qt Champions 2016
                                      wrote on last edited by ekkescorner
                                      #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 last edited by
                                        #18
                                        This post is deleted!
                                        1 Reply Last reply
                                        0
                                        • mzimmersM Offline
                                          mzimmersM Offline
                                          mzimmers
                                          wrote on 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...

                                          ekkescornerE JKSHJ 2 Replies Last reply
                                          0
                                          • mzimmersM mzimmers

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

                                            ekkescornerE Offline
                                            ekkescornerE Offline
                                            ekkescorner
                                            Qt Champions 2016
                                            wrote on 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

                                            • Login

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