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. purpose of android folder?
Forum Updated to NodeBB v4.3 + New Features

purpose of android folder?

Scheduled Pinned Locked Moved Solved Mobile and Embedded
14 Posts 2 Posters 2.2k 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.
  • M Offline
    M Offline
    mzimmers
    wrote on 6 Dec 2022, 18:09 last edited by
    #1

    Hi all -

    I'm trying to correctly build and deploy the example on this page. I notice that the CMakeLists.txt file expects an android folder under the main project folder.

    1. am I expected to create this myself?
    2. what (if anything) do I put into it?
    3. do I need to change any build settings for using it?

    Thanks...

    1 Reply Last reply
    0
    • J Offline
      J Offline
      JoeCFD
      wrote on 6 Dec 2022, 18:18 last edited by JoeCFD 12 Jun 2022, 18:29
      #2

      You have to have it by yourself or from qt creator. I made it by myself and set all build files(for android and linux with qmake and cmake) under one dir(s)=buildfiles.
      ANDROID_PACKAGE_SOURCE_DIR = $$PWD/../android <==in qmake
      set( ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/buildfiles/android CACHE INTERNAL "" ) <==in cmake

      Contents in it are: gradle stuff(generated by qtcreator), AndroidManifest.xml, app icon settings, your interface to android Java, etc.

      M 1 Reply Last reply 6 Dec 2022, 20:15
      1
      • J JoeCFD
        6 Dec 2022, 18:18

        You have to have it by yourself or from qt creator. I made it by myself and set all build files(for android and linux with qmake and cmake) under one dir(s)=buildfiles.
        ANDROID_PACKAGE_SOURCE_DIR = $$PWD/../android <==in qmake
        set( ANDROID_PACKAGE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/buildfiles/android CACHE INTERNAL "" ) <==in cmake

        Contents in it are: gradle stuff(generated by qtcreator), AndroidManifest.xml, app icon settings, your interface to android Java, etc.

        M Offline
        M Offline
        mzimmers
        wrote on 6 Dec 2022, 20:15 last edited by
        #3

        @JoeCFD when you say "build files" does that mean your source files (.qml, .svg, etc)?

        I have a similar entry in the CMakeLists.txt file from the example, but when I try to run, I get this error:

        W libappaccelbubble_x86_64.so: QQmlApplicationEngine failed to load component
        W libappaccelbubble_x86_64.so: qrc:/bubble/main.qml: No such file or directory
        
        J 1 Reply Last reply 6 Dec 2022, 20:25
        0
        • M mzimmers
          6 Dec 2022, 20:15

          @JoeCFD when you say "build files" does that mean your source files (.qml, .svg, etc)?

          I have a similar entry in the CMakeLists.txt file from the example, but when I try to run, I get this error:

          W libappaccelbubble_x86_64.so: QQmlApplicationEngine failed to load component
          W libappaccelbubble_x86_64.so: qrc:/bubble/main.qml: No such file or directory
          
          J Offline
          J Offline
          JoeCFD
          wrote on 6 Dec 2022, 20:25 last edited by JoeCFD 12 Jun 2022, 20:32
          #4

          @mzimmers no, do not get confused. I have a bunch of pri(s) and cmake files for android and Linux builds. I simply organize them in one dir(buildfiles) + subdirs. android dir is under buildfiles.

          M 1 Reply Last reply 6 Dec 2022, 22:13
          0
          • J JoeCFD
            6 Dec 2022, 20:25

            @mzimmers no, do not get confused. I have a bunch of pri(s) and cmake files for android and Linux builds. I simply organize them in one dir(buildfiles) + subdirs. android dir is under buildfiles.

            M Offline
            M Offline
            mzimmers
            wrote on 6 Dec 2022, 22:13 last edited by
            #5

            @JoeCFD OK, so then why am I getting the error above? It goes away if I comment out the "/android" part of the line you posted (for CMake).

            J 1 Reply Last reply 6 Dec 2022, 22:20
            0
            • M mzimmers
              6 Dec 2022, 22:13

              @JoeCFD OK, so then why am I getting the error above? It goes away if I comment out the "/android" part of the line you posted (for CMake).

              J Offline
              J Offline
              JoeCFD
              wrote on 6 Dec 2022, 22:20 last edited by
              #6

              @mzimmers https://doc.qt.io/qt-6/cmake-target-property-qt-android-package-source-dir.html

              M 1 Reply Last reply 6 Dec 2022, 22:25
              0
              • J JoeCFD
                6 Dec 2022, 22:20

                @mzimmers https://doc.qt.io/qt-6/cmake-target-property-qt-android-package-source-dir.html

                M Offline
                M Offline
                mzimmers
                wrote on 6 Dec 2022, 22:25 last edited by
                #7

                @JoeCFD the example I cited in my original post has this in its CMakeLists.txt file:

                set_property(TARGET appaccelbubble APPEND PROPERTY
                    QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
                )
                

                If I build the example as-is, I get the error I posted. If I comment out the "/android" it works.

                I'm asking why that is.

                J 1 Reply Last reply 6 Dec 2022, 22:29
                0
                • M mzimmers
                  6 Dec 2022, 22:25

                  @JoeCFD the example I cited in my original post has this in its CMakeLists.txt file:

                  set_property(TARGET appaccelbubble APPEND PROPERTY
                      QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
                  )
                  

                  If I build the example as-is, I get the error I posted. If I comment out the "/android" it works.

                  I'm asking why that is.

                  J Offline
                  J Offline
                  JoeCFD
                  wrote on 6 Dec 2022, 22:29 last edited by JoeCFD 12 Jun 2022, 22:30
                  #8

                  @mzimmers message( "=============${CMAKE_CURRENT_SOURCE_DIR}") ==>print out to see the path.
                  it is possible that CMAKE_CURRENT_SOURCE_DIR has /android

                  M 1 Reply Last reply 6 Dec 2022, 22:45
                  0
                  • J JoeCFD
                    6 Dec 2022, 22:29

                    @mzimmers message( "=============${CMAKE_CURRENT_SOURCE_DIR}") ==>print out to see the path.
                    it is possible that CMAKE_CURRENT_SOURCE_DIR has /android

                    M Offline
                    M Offline
                    mzimmers
                    wrote on 6 Dec 2022, 22:45 last edited by
                    #9

                    @JoeCFD

                    =============C:/Users/Michael.Zimmers/Qt_projects/bubble
                    

                    bubble.PNG

                    J 1 Reply Last reply 6 Dec 2022, 22:54
                    0
                    • M mzimmers
                      6 Dec 2022, 22:45

                      @JoeCFD

                      =============C:/Users/Michael.Zimmers/Qt_projects/bubble
                      

                      bubble.PNG

                      J Offline
                      J Offline
                      JoeCFD
                      wrote on 6 Dec 2022, 22:54 last edited by JoeCFD 12 Jun 2022, 22:56
                      #10

                      @mzimmers sorry I did not realize this one QT_ANDROID_PACKAGE_SOURCE_DIR was introduced in Qt6. Mine is ANDROID_PACKAGE_SOURCE_DIR in qt 5 apps. It is the case that QT_ANDROID_PACKAGE_SOURCE_DIR does not need /android. I have not started to use Qt6.

                      1 Reply Last reply
                      1
                      • M Offline
                        M Offline
                        mzimmers
                        wrote on 6 Dec 2022, 22:59 last edited by
                        #11

                        Oh...so this is something of a Qt 5 artifact? OK, that makes sense...I guess whoever maintains the Qt examples missed this (I did pull it from the Qt 6 examples).

                        So...now, let's turn this question around: let's say I want to use this folder, so all those Android files don't clutter up my main folder. How do I enable that?

                        J 1 Reply Last reply 6 Dec 2022, 23:06
                        0
                        • M mzimmers
                          6 Dec 2022, 22:59

                          Oh...so this is something of a Qt 5 artifact? OK, that makes sense...I guess whoever maintains the Qt examples missed this (I did pull it from the Qt 6 examples).

                          So...now, let's turn this question around: let's say I want to use this folder, so all those Android files don't clutter up my main folder. How do I enable that?

                          J Offline
                          J Offline
                          JoeCFD
                          wrote on 6 Dec 2022, 23:06 last edited by
                          #12

                          @mzimmers do not mess up with android folder unless it is necessary. I put it under buildfiles since you may have some .cmake files.

                          M 1 Reply Last reply 6 Dec 2022, 23:40
                          0
                          • J JoeCFD
                            6 Dec 2022, 23:06

                            @mzimmers do not mess up with android folder unless it is necessary. I put it under buildfiles since you may have some .cmake files.

                            M Offline
                            M Offline
                            mzimmers
                            wrote on 6 Dec 2022, 23:40 last edited by
                            #13

                            @JoeCFD OK, so do I need this folder under my main project folder? So far, it looks like I can do without it.

                            J 1 Reply Last reply 6 Dec 2022, 23:58
                            0
                            • M mzimmers
                              6 Dec 2022, 23:40

                              @JoeCFD OK, so do I need this folder under my main project folder? So far, it looks like I can do without it.

                              J Offline
                              J Offline
                              JoeCFD
                              wrote on 6 Dec 2022, 23:58 last edited by JoeCFD 12 Jun 2022, 23:58
                              #14

                              @mzimmers You can put it anywhere, but set its path with QT_ANDROID_PACKAGE_SOURCE_DIR. You do not need it now because all its contents may have been copied into android-build. Where does your app get AndroidManifest.xml if your build dir is removed? This dir is part of your android app.

                              1 Reply Last reply
                              1

                              1/14

                              6 Dec 2022, 18:09

                              • Login

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