Android build now fails (used to work)
-
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.
-
@JoeCFD I've tried that. No luck. It gets replaced with the "mystery version."
Regarding permissions: here's what Windows thinks:
BUT: This from a MINGW64 window:
So...I truly don't know what's going on.
@mzimmers More arbitrary thoughts:
-
Are the contents of the "mystery version" the same as the one in your Qt6.4 installation, which would be in c:/Qt/Qt6.4.2/android_arm64_v8a/src/android/templates/AndroidManifest.xml or somewhere similar?
It may be that during the build process Qt copies the default template version to the build directory first, then overwrites it with your project version. If this is the case, it would be worth looking at the permissions on the file in the Qt templates directory. -
Try creating yourself a new Windows user (I would say one without the "." in the pathname) and building the project afresh from there.
-
And another possible thing to try is to completely uninstall Qt and reinstall.
-
-
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.
-
@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?
-
@JoeCFD building on Windows 10; using CMake.
I've tried deleting just the manifest file before building; get the same error.
@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.
-
@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.
-
@JoeCFD same result. The file is actually gone (I checked), but when I build, it comes back, and then I get the error message.
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...
-
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...
-
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...
@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?
-
@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?
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...
-
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...
@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.
-
@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.
-
@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?
@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
-
@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
@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.
-
@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.
-
@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.
-
@JoeCFD I've tried that. No luck. It gets replaced with the "mystery version."
Regarding permissions: here's what Windows thinks:
BUT: This from a MINGW64 window:
So...I truly don't know what's going on.
@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.
-
@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.
-
@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?
-
@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...
-
@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...