Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Failed to upload file; project keeps refering to non-used image file
Probably not the first time asked, but this annoying issue keeps popping up once in a while:
"error: Failed to upload file '/home/ccs/Desktop/...../gauge_CoolantTemp_C_v3.png'.
"File not found"
This usually happens when adding an image file to one of the QRC resources (got multiple), and then deleting it again. Even though the file isn't used anymore and nowhere to be found in the Qt project when searching on the filename, it still keeps trying to find this file. Usually it got fixed by putting the file back again (on the disc, not in the Qt project), rebuild stuff, and then after a while it was gone. A bit vague...
This time the issue is slightly different. The Qt project compiles fine under a Virtual Machine setting. But once I try to deploy it to a (32 bit ARM Linux) device, it keeps nagging about a file again.
A: The "missing" file just exists, didn't delete it from the disk yet.
B: The file is nowhere used. Searched through files, removed auto made qrc files (*.o / *.cpp)
C: did a clean / run qmake / rebuild several times
So what could be still refering to this file, why can't the deployment process find an existing file, and mist important, how to fix?
Got to mention that I successfully deployed the same project with many image files many times. No idea how it got stuck now.
Hi and welcome to devnet,
when all else fails, did you also delete the build directory ?
Deleted several files, but probably not everything as you mentioned. I'm kinda new to Qt though, so you could you tell me which files are safe to be deleted? Asides from the directory I made myself, I can't see any particular Build folder. A lot of auto-generated files are placed in the root folder though.
Using Qt Creator 2.6.0 btw
Oh, and excuses if I can't try & reply the suggestions quickly. Some minutes ago Windows blue-screened, and that locked up VM-Ware that runs Ubuntu and this project.... Got to find a fix somehow.
If you are using a shadow build (which should be the default with Qt Creator) you can delete the complete shadow build directory
Just recovered VM-Ware with an older back-up, we're up and running again. Though the error described above is still alive hehe.
Shadow-builds are disabled on this project.
By the way, why does this image file need to be placed on the remote device anyway? All the image data is inside the Executable file itself, rather than loaded on the fly from the HD. I didn't explicitely tell to deploy this file, other than adding it to a QRC file (and removed it again). Maybe I did something stupid, but it sounds like Qt isn't handling this very well.
Thanks for helping!
Then you have to search for all generated files and remove them.
Are you sure that you use a qrc path in your code for this file ?
Deleted all files in the root folder except the main.cpp / h, xxx.qrc, and the ui_xxx files. But no success. I find it strange that the image name is nowhere mentioned in any of those files (did a search through ALL files). Not sure if the search will also succeed on binary files though.
The image path can't be outside the project folder either, because due the VM-ware crash yesterday, I only copied back this folder. If the project was using files outside the project folder, it couldn't refer to this image which was only added very recently.
The paths are written like ":/images/a.png". Also, when deleting all images on the device, the project still works & shows all images, so it isn't loading anything from its (flash) memory.
Btw, I think I had this issue in the past as well. I believe I deleted the entire qrc file, and remade it to fix the problem. That might be an eventual work-around, but not a nice one of course.
There must be somewhere some generated files that are not deleted. Are you setting some output folders in your pro file ?
I bet there are, can't be magic holding up this reference :)
Maybe I found it. Indeed, the PRO file refered to folders. Not specifically to this file, but it had this:
someFolderFiles.files = SomeFolder/*
someFolderFiles.path = /opt/POG_Monitor/SomeFolder
INSTALLS += someFolderFiles
When commenting it, the project managed to run. But I now missed some other (non image) files, so I re-enabled the code.
As for the "fix" then,
Although the compiler said it can't find the PGN file, it really is there. So I simply deleted it from the harddrive (actually I had to remove all files in that folder). And now it runs again... Could it be that those files were locked/protected or damaged somehow?
Anyway, thanks for helping!