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 build now fails (used to work)
Forum Updated to NodeBB v4.3 + New Features

Android build now fails (used to work)

Scheduled Pinned Locked Moved Solved Mobile and Embedded
23 Posts 4 Posters 3.5k Views 2 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.
  • mzimmersM mzimmers

    Hi all -

    I'm developing an app for desktop and Android deployment. I do most of my development for the desktop and periodically build and run on Android just to be sure nothing has broken. Well...something has broken.

    I now get an error:

    Can't remove old file: <my build directory>/android-build/AndroidManifest.xml
    

    I've checked file permissions and gone so far as to delete the entire build directory; the error persists. Any ideas on what might have happened here?

    Thanks...

    Qt 6.4.2; Creator 9.0.1.

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

    @mzimmers I guess AndroidManifest.xml is copied over to the build dir likely every time in build. Are you building it on Windows or Linux? CMake or QMake?

    mzimmersM 1 Reply Last reply
    0
    • JoeCFDJ JoeCFD

      @mzimmers I guess AndroidManifest.xml is copied over to the build dir likely every time in build. Are you building it on Windows or Linux? CMake or QMake?

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

      @JoeCFD building on Windows 10; using CMake.

      I've tried deleting just the manifest file before building; get the same error.

      JoeCFDJ 1 Reply Last reply
      0
      • mzimmersM mzimmers

        @JoeCFD building on Windows 10; using CMake.

        I've tried deleting just the manifest file before building; get the same error.

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

        @mzimmers Can you try to remove it from command line manually? Then build.

        Disable file indexing: If the file is being indexed by the operating system, it might be causing issues when trying to delete it. You can try disabling the file indexing for the directory containing the file and then try to delete it again.

        Maybe the best way to try on Windows is to reboot your machine.

        mzimmersM 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          @mzimmers Can you try to remove it from command line manually? Then build.

          Disable file indexing: If the file is being indexed by the operating system, it might be causing issues when trying to delete it. You can try disabling the file indexing for the directory containing the file and then try to delete it again.

          Maybe the best way to try on Windows is to reboot your machine.

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

          @JoeCFD same result. The file is actually gone (I checked), but when I build, it comes back, and then I get the error message.

          mzimmersM 1 Reply Last reply
          0
          • mzimmersM mzimmers

            @JoeCFD same result. The file is actually gone (I checked), but when I build, it comes back, and then I get the error message.

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

            BTT

            Anyone have any ideas? I tried building another project (that also used to work) and got the same error.

            What's kind of surprising, also, is the timestamp on the .xml file in question - it doesn't match the file in my project, and I have no idea where it's coming from.

            I'll accept any suggestions, no matter how far-fetched...this is about to become a situation for me.

            Thanks...

            piervalliP KenAppleby 0K 2 Replies Last reply
            0
            • mzimmersM mzimmers

              BTT

              Anyone have any ideas? I tried building another project (that also used to work) and got the same error.

              What's kind of surprising, also, is the timestamp on the .xml file in question - it doesn't match the file in my project, and I have no idea where it's coming from.

              I'll accept any suggestions, no matter how far-fetched...this is about to become a situation for me.

              Thanks...

              piervalliP Offline
              piervalliP Offline
              piervalli
              wrote on last edited by
              #7

              @mzimmers
              When you have the error try to identity what is the process that lock it.

              Useful link
              https://helpcenter.gsx.com/hc/en-us/articles/115015880627-How-to-Identify-which-Windows-Process-is-Locking-a-File-or-Folder

              1 Reply Last reply
              0
              • mzimmersM mzimmers

                BTT

                Anyone have any ideas? I tried building another project (that also used to work) and got the same error.

                What's kind of surprising, also, is the timestamp on the .xml file in question - it doesn't match the file in my project, and I have no idea where it's coming from.

                I'll accept any suggestions, no matter how far-fetched...this is about to become a situation for me.

                Thanks...

                KenAppleby 0K Offline
                KenAppleby 0K Offline
                KenAppleby 0
                wrote on last edited by
                #8

                @mzimmers: random thoughts along the lines that a build step is getting confused about pathnames:

                • do you have multiple android executables at the same level in your project tree? If so, try nesting them more deeply.
                • do the shadow build directories for your different projects all share the same parent directory? If so, try nesting your projects more deeply.
                • are you using any pathnames that contain whitespace?
                • have you tried moving the project source root to a completely new location in the file system and building there?
                mzimmersM 1 Reply Last reply
                0
                • KenAppleby 0K KenAppleby 0

                  @mzimmers: random thoughts along the lines that a build step is getting confused about pathnames:

                  • do you have multiple android executables at the same level in your project tree? If so, try nesting them more deeply.
                  • do the shadow build directories for your different projects all share the same parent directory? If so, try nesting your projects more deeply.
                  • are you using any pathnames that contain whitespace?
                  • have you tried moving the project source root to a completely new location in the file system and building there?
                  mzimmersM Offline
                  mzimmersM Offline
                  mzimmers
                  wrote on last edited by
                  #9

                  Thanks for the suggestions, guys.

                  @piervalli unfortunately Qt Creator doesn't seem to show up in Process Explorer, so I can't get much help from it. I don't think the issue is a file lock, anyway.

                  @KenAppleby-0 my project only generates one executable (either for desktop or for Android). No whitespace in pathnames. And the directory structure I'm using used to build fine. (Still does for desktop.) I moved the project and tried to build -- same results.

                  I've done a little more looking, and I notice that the file in question (as well as all of the files in the android-build directory) are all 444 (read-only for everyone). Might this have something to do with my problem?

                  I also don't understand why the build process is trying to remove that file in the first place; it just put it there. I really don't understand the Android build process.

                  Any suggestions? Thanks...

                  JoeCFDJ 1 Reply Last reply
                  0
                  • mzimmersM mzimmers

                    Thanks for the suggestions, guys.

                    @piervalli unfortunately Qt Creator doesn't seem to show up in Process Explorer, so I can't get much help from it. I don't think the issue is a file lock, anyway.

                    @KenAppleby-0 my project only generates one executable (either for desktop or for Android). No whitespace in pathnames. And the directory structure I'm using used to build fine. (Still does for desktop.) I moved the project and tried to build -- same results.

                    I've done a little more looking, and I notice that the file in question (as well as all of the files in the android-build directory) are all 444 (read-only for everyone). Might this have something to do with my problem?

                    I also don't understand why the build process is trying to remove that file in the first place; it just put it there. I really don't understand the Android build process.

                    Any suggestions? Thanks...

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

                    @mzimmers said in Android build now fails (used to work):

                    the build process is trying to remove that file in the first place

                    This file at the place is a copy of the one you setup. Every time it has to be replaced in build because it may be changed. This is reasonable.

                    mzimmersM 1 Reply Last reply
                    0
                    • JoeCFDJ JoeCFD

                      @mzimmers said in Android build now fails (used to work):

                      the build process is trying to remove that file in the first place

                      This file at the place is a copy of the one you setup. Every time it has to be replaced in build because it may be changed. This is reasonable.

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

                      @JoeCFD OK, but where is the original file? It isn't from my project android folder -- that file is different, and has a different datestamp. Where is the file coming from?

                      JoeCFDJ 1 Reply Last reply
                      0
                      • mzimmersM mzimmers

                        @JoeCFD OK, but where is the original file? It isn't from my project android folder -- that file is different, and has a different datestamp. Where is the file coming from?

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

                        @mzimmers AndroidManifest.xml is an important file and located normally under android dir. Qt gives the flexibility for the user to put it anywhere and it can be set in qmake or cmake file with path. But it has a fixed location in build dir and is a copy of the one you set-up. For example,mine is under buildfiles/android

                        mzimmersM 1 Reply Last reply
                        0
                        • JoeCFDJ JoeCFD

                          @mzimmers AndroidManifest.xml is an important file and located normally under android dir. Qt gives the flexibility for the user to put it anywhere and it can be set in qmake or cmake file with path. But it has a fixed location in build dir and is a copy of the one you set-up. For example,mine is under buildfiles/android

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

                          @JoeCFD Here's the complete error messaging:

                          Can't remove old file: C:/Users/Michael.Zimmers/Qt_projects/build-nga_demo-Android_Qt_6_4_2_Clang_arm64_v8a-Release/android-build/AndroidManifest.xml
                          16:17:05: The process "C:\Qt\6.4.2\mingw_64\bin\androiddeployqt.exe" exited with code 3.
                          Error while building/deploying project nga_demo (kit: Android Qt 6.4.2 Clang arm64-v8a)
                          When executing step "Build Android APK"
                          

                          Code 3 is "the system cannot find the specified path" which makes no sense, as that path is definitely there.

                          JoeCFDJ 1 Reply Last reply
                          0
                          • mzimmersM mzimmers

                            @JoeCFD Here's the complete error messaging:

                            Can't remove old file: C:/Users/Michael.Zimmers/Qt_projects/build-nga_demo-Android_Qt_6_4_2_Clang_arm64_v8a-Release/android-build/AndroidManifest.xml
                            16:17:05: The process "C:\Qt\6.4.2\mingw_64\bin\androiddeployqt.exe" exited with code 3.
                            Error while building/deploying project nga_demo (kit: Android Qt 6.4.2 Clang arm64-v8a)
                            When executing step "Build Android APK"
                            

                            Code 3 is "the system cannot find the specified path" which makes no sense, as that path is definitely there.

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

                            @mzimmers can you copy your xml file to the place? Then it will be available. If it is read only, build will not work either.

                            mzimmersM 1 Reply Last reply
                            0
                            • JoeCFDJ JoeCFD

                              @mzimmers can you copy your xml file to the place? Then it will be available. If it is read only, build will not work either.

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

                              @JoeCFD I've tried that. No luck. It gets replaced with the "mystery version."

                              Regarding permissions: here's what Windows thinks:
                              windows.PNG

                              BUT: This from a MINGW64 window:
                              ming.PNG

                              So...I truly don't know what's going on.

                              JoeCFDJ KenAppleby 0K 2 Replies Last reply
                              0
                              • mzimmersM mzimmers

                                @JoeCFD I've tried that. No luck. It gets replaced with the "mystery version."

                                Regarding permissions: here's what Windows thinks:
                                windows.PNG

                                BUT: This from a MINGW64 window:
                                ming.PNG

                                So...I truly don't know what's going on.

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

                                @mzimmers It could be a Qt bug in qtcreator as well although it may not be. Otherwise, there will be more people who will complain. Check write permissions of all parent dirs of build dir. You can see gradle stuff and xml file will be copied there every time in build. Check out how to set permissions for the whole dir. I am not in the office and can not check the build commands of QtCreator.

                                mzimmersM 1 Reply Last reply
                                0
                                • JoeCFDJ JoeCFD

                                  @mzimmers It could be a Qt bug in qtcreator as well although it may not be. Otherwise, there will be more people who will complain. Check write permissions of all parent dirs of build dir. You can see gradle stuff and xml file will be copied there every time in build. Check out how to set permissions for the whole dir. I am not in the office and can not check the build commands of QtCreator.

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

                                  @JoeCFD doubtful that it's a Qt bug -- this used to work, and I haven't updated lately.

                                  I copied my project to a different folder - same result.

                                  Weird, huh?

                                  JoeCFDJ 1 Reply Last reply
                                  0
                                  • mzimmersM mzimmers

                                    @JoeCFD doubtful that it's a Qt bug -- this used to work, and I haven't updated lately.

                                    I copied my project to a different folder - same result.

                                    Weird, huh?

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

                                    @mzimmers It is a Windows problem. Somehow, the write permissions of build dir are gone.

                                    mzimmersM 1 Reply Last reply
                                    0
                                    • JoeCFDJ JoeCFD

                                      @mzimmers It is a Windows problem. Somehow, the write permissions of build dir are gone.

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

                                      @JoeCFD said in Android build now fails (used to work):

                                      @mzimmers It is a Windows problem. Somehow, the write permissions of build dir are gone.

                                      Hmm...I did update Windows recently. Aargh...fortunately, I'm getting a Linux box soon.

                                      I wonder if this is worth reporting...

                                      JoeCFDJ 1 Reply Last reply
                                      0
                                      • mzimmersM mzimmers

                                        @JoeCFD said in Android build now fails (used to work):

                                        @mzimmers It is a Windows problem. Somehow, the write permissions of build dir are gone.

                                        Hmm...I did update Windows recently. Aargh...fortunately, I'm getting a Linux box soon.

                                        I wonder if this is worth reporting...

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

                                        @mzimmers Linux Box? A virtual machine is OK as well.

                                        piervalliP 1 Reply Last reply
                                        0
                                        • JoeCFDJ JoeCFD

                                          @mzimmers Linux Box? A virtual machine is OK as well.

                                          piervalliP Offline
                                          piervalliP Offline
                                          piervalli
                                          wrote on last edited by piervalli
                                          #21

                                          @JoeCFD
                                          Have you checked in the release of Qt 6.4.1, the minum version of SDK and ndk Android?

                                          Java version?
                                          Last try to move the project in c:\data\ , so the path is more short of under users, I remember a bug with long path

                                          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