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 set icon for Qt Android app in CMake?

How to set icon for Qt Android app in CMake?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
27 Posts 7 Posters 4.9k 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.
  • A Offline
    A Offline
    Akshai
    wrote on 28 Oct 2022, 17:07 last edited by
    #3

    I have gone through the steps mentioned in that link. Could not get the expected result. Please guide me ...

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 28 Oct 2022, 18:53 last edited by
      #4

      What exactly did you do ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • A Offline
        A Offline
        Akshai
        wrote on 28 Oct 2022, 20:17 last edited by Akshai
        #5

        @SGaist Please see steps below.

        1. Created Qt android project in CMake and build in release mode.
        2. Created a folder named "android" in project folder (Where CMakeLists.txt file exist)
        3. Copied "AndroidManifest.xml" from "android-build" folder and paste it to "android" folder which already created in step 2.
        4. Open Projects option Qt , and under "Build Android APK" option selected "Create Templates" and edited "AndroidManifest.xml" (Added icon)
        5. Build again and deployed. The icon not updated.!

        Please see my edited "AndroidManifest.xml" file below.
        Capture.PNG

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 29 Oct 2022, 19:09 last edited by
          #6

          Check the xml file in the build folder to see if it has changed. If not, delete the build folder and start anew.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          A 1 Reply Last reply 29 Oct 2022, 21:20
          0
          • S SGaist
            29 Oct 2022, 19:09

            Check the xml file in the build folder to see if it has changed. If not, delete the build folder and start anew.

            A Offline
            A Offline
            Akshai
            wrote on 29 Oct 2022, 21:20 last edited by
            #7

            @SGaist I checked "AndroidManifest.xml" file in the build folder, it is not changed. "AndroidManifest.xml" file in the build folder will update everytime when we building. So if i modified the file, it will not reflect in the build apk.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 30 Oct 2022, 20:19 last edited by
              #8

              It's not that one that you have to change. It's the one you copied into your sources. It should then be used when building your application.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              A 1 Reply Last reply 31 Oct 2022, 15:30
              0
              • S SGaist
                30 Oct 2022, 20:19

                It's not that one that you have to change. It's the one you copied into your sources. It should then be used when building your application.

                A Offline
                A Offline
                Akshai
                wrote on 31 Oct 2022, 15:30 last edited by
                #9

                @SGaist I could not set the modified "AndroidManifest.xml" path which should be used when building your application. How can i set through "CMakeLists.txt" file?

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on 31 Oct 2022, 19:52 last edited by
                  #10

                  Did you already do what is described here ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  A 1 Reply Last reply 2 Nov 2022, 18:55
                  0
                  • S SGaist
                    31 Oct 2022, 19:52

                    Did you already do what is described here ?

                    A Offline
                    A Offline
                    Akshai
                    wrote on 2 Nov 2022, 18:55 last edited by
                    #11

                    @SGaist Yes i did it in the way. But no result. Please see my attached screenshot. Qt_Forum_Question_Details.png

                    1 Reply Last reply
                    0
                    • S Offline
                      S Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on 2 Nov 2022, 19:38 last edited by
                      #12

                      Which version of Qt are you using ?

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      A 1 Reply Last reply 2 Nov 2022, 19:46
                      0
                      • S SGaist
                        2 Nov 2022, 19:38

                        Which version of Qt are you using ?

                        A Offline
                        A Offline
                        Akshai
                        wrote on 2 Nov 2022, 19:46 last edited by
                        #13

                        @SGaist Latest one.Capture.PNG

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 2 Nov 2022, 19:47 last edited by
                          #14

                          That's Qt Creator. I am asking which version you use to build your application.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          A 1 Reply Last reply 2 Nov 2022, 19:56
                          0
                          • S SGaist
                            2 Nov 2022, 19:47

                            That's Qt Creator. I am asking which version you use to build your application.

                            A Offline
                            A Offline
                            Akshai
                            wrote on 2 Nov 2022, 19:56 last edited by
                            #15

                            @SGaist This one.aaa.png

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 2 Nov 2022, 19:59 last edited by
                              #16

                              So you put your Androïd related changes in the else clause that concerns Qt 5.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              A 1 Reply Last reply 2 Nov 2022, 20:22
                              0
                              • S SGaist
                                2 Nov 2022, 19:59

                                So you put your Androïd related changes in the else clause that concerns Qt 5.

                                A Offline
                                A Offline
                                Akshai
                                wrote on 2 Nov 2022, 20:22 last edited by
                                #17

                                @SGaist What to do? please guide me.

                                1 Reply Last reply
                                0
                                • S Offline
                                  S Offline
                                  SGaist
                                  Lifetime Qt Champion
                                  wrote on 2 Nov 2022, 20:27 last edited by
                                  #18

                                  Move your changes to the Qt 6 part of the if.

                                  Interested in AI ? www.idiap.ch
                                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  A 1 Reply Last reply 2 Nov 2022, 20:36
                                  0
                                  • S SGaist
                                    2 Nov 2022, 20:27

                                    Move your changes to the Qt 6 part of the if.

                                    A Offline
                                    A Offline
                                    Akshai
                                    wrote on 2 Nov 2022, 20:36 last edited by
                                    #19

                                    @SGaist Done as mentioned. But there is no change found. Please see screenshot.aaa.png

                                    J 1 Reply Last reply 3 Nov 2022, 10:09
                                    0
                                    • S Offline
                                      S Offline
                                      sierdzio
                                      Moderators
                                      wrote on 3 Nov 2022, 09:05 last edited by
                                      #20

                                      Remember to do a full rebuild (clean, run cmake, rebuild) when you change cmake code.

                                      (Z(:^

                                      A 1 Reply Last reply 4 Nov 2022, 18:44
                                      0
                                      • A Akshai
                                        2 Nov 2022, 20:36

                                        @SGaist Done as mentioned. But there is no change found. Please see screenshot.aaa.png

                                        J Online
                                        J Online
                                        J.Hilk
                                        Moderators
                                        wrote on 3 Nov 2022, 10:09 last edited by
                                        #21

                                        @Akshai also, delete the app from your device, let it install fresh


                                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                        Q: What's that?
                                        A: It's blue light.
                                        Q: What does it do?
                                        A: It turns blue.

                                        1 Reply Last reply
                                        0
                                        • S sierdzio
                                          3 Nov 2022, 09:05

                                          Remember to do a full rebuild (clean, run cmake, rebuild) when you change cmake code.

                                          A Offline
                                          A Offline
                                          Akshai
                                          wrote on 4 Nov 2022, 18:44 last edited by
                                          #22

                                          @sierdzio @J-Hilk I have done as you guys mentioned. Couldn't found any change.

                                          aaa.png

                                          1 Reply Last reply
                                          0

                                          12/27

                                          2 Nov 2022, 19:38

                                          • Login

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