Qt : no rule to make target after deleting picture - qt

I accidentally permanently deleted one of my picture files today (it was added to the Qt resource file earlier) through File Explorer (not deleting it via Qt Creator). Now whenever I try to build my project, I keep getting a message that says:
No rule to make target "mypic.png" needed by "qrcfile.cpp". Stop
What can I do to fix this problem ?

So I think I found the solution to this. All I did was clicking Clean all, then Build All, then Run qmake. After those steps, I tried running the project and it worked!

Related

How to solve this error? - 'Resource.Layout' does not contain a definition for axml file

Am new to Xamarin and is currently building a very simple app using the tutorial from Youtube. Am just in a middle of the video when I got this error even tho I carefully followed all instructions. And even the instructor in the video was able to run his app successfully
Here's the code where I'm getting the error:
var view = inflater.Inflate(Resource.Layout.SignUp, container, false);
For me it is caused by namespace changes. After I corrected the namespace in project properties, then I can build again
I just deleted my newly created axml file, rebuild, add it again, and this time, clean and rebuild.
Everytime I added a new axml file, I clean and rebuild. That's all, thank you :).
Actually this problem occurs when your ResourceDesigner.cs file has not yet mapped the file that you added to your resource directory.
The easiest way i would suggest to handle this situation is you comment the code you are trying to write and clean build your project and it will work like a charm.
Good luck!
In my Resource.Layout.toolbar, Resource was ambiguous between Android.Resource and Xamarin.Forms.Platform.Android.Resource. Instead the one that works for me is [Project name].Droid.Resource. Clean, deleted bin/debug and now it's fine
Resource.designer.cs was excluded from project. Solved by including back.
In Xamarin.Android this problem can be resolved by saving other axml/xml file. Many times cleaning solution, deleting bins/obj doesn't working for me.
In my case my Main file was configured in the Build Action as AndroidResourceAnalysisConfig and then change property to AndroidResource then Build my project and it works.
I had a lot of "XXX" does not contain "XXX" errors like this after a git reverse operation. Very annoying.
I tried all the solutions I could find, all without luck. Finally I magically fixed it by going to the Android project properties, Android Options, then unchecked "Use Fast Deployment (debug mode only)". I then built the project and it worked. Then I went back and checked that option so it was back to normal, and everything is fine.

Why Files misteriously disappear from xcode with this strange symptom?

I use time machine and drop box to synchronize stuffs.
Recently I found that some files are gone.
However, the project compiles just fine as if the file is there. My friend cannot compile though.
This is very frustating. I got to find the missing files and then restore it from time machine and then readd that to xcode. I don't even know what files are missing.
I used dropbox and time machine. Looks like file disappear, the file names becomes "red" in xcode for a while and then poof it's gone. Xcode automatically remove the files from the project. The project still compiles fine which is frustating. If the project doesn't compile, I will know ah this file is missing.
Looks like somehow xcode still have the file but doesn't show it. Files is not on finder either.
What could possibly be the explanation and how to fix that.
I have clean projects to make sure that my computer do not use cached files.
It still compile fines in my computer
The file is still missing in project navigator
My friends' computer that uses the EXACT same files (connected to drop box) cannot compile
For example, xcdatamodeld files are crucial. In my computer it still run fine without that file even though that file is obviously needed. Xcode behaves as if the file is there all along.
My friends' try to compile the project and crash.
Also there is a PNG file. In my computer it runs fine with the icons showing up. In my friends computer the icons doesn't show up at all.
For anyone who still have the problem, in my case Xcode6. It turns out somehow the "Show only files with source control status" and "Show recent file button" is enable. It located in the bottom of left sidebar.
This somehow happen after I update os to Yosemite.
Cheers
Go to the project navigator (top left folder symbol). Files that are not found by XCode are displayed in red. But since your project compiles fine, there should not be any that are required. Now click one of the "missing" files to activate it. Open the utility area on the right side, and show file inspector. Under "location" you find the full path of this file. Probably, your XCode project uses just references to these "missing" files that are stored somewhere else, and not in your project folder.
I had the same problem ..then I added the files explicitly into our project…which resulted into Duplicate Symbols error …we solved that by following….
In Your Project go to targets-
At the bottom Bar of your Targets there are three options..
1.Add Target
2. Validate Settings
3. Build RUle..
Click on validate Settings….it will ask for you to remove the Duplicated files from the project do it…ur project would run fine

grails project does not appear to be part of a Grails application

After migrating from my old Macbook Pro to my new one, I find that my project will no longer run. Grails keeps giving me a "Error /Users/Michael/{proj}/{proj} does not appear to be part of a Grails application". Refresh dependencies does seem to run successfully.
I have verified the following:
there exists a folder grails-app in the project folder at the same location as on the old machine.
I did run a grails clean followed by a grails upgrade to 2.0.4
The one thing it could be is that the user directory name has changed between the two machines, but I do not see the old user directory name in either .project or application.properties or in any settings.
I solved this by deleting workspace\.metadata\.plugins\org.eclipse.debug.core\.launches\<project>.launch. It had cached the old absolute path.
Open the command line from within STS and executed a "run-app". There is sometime a problem with he workspace caches.
oops, saw that I had left this question unanswered.
The answer was to erase everything and rebuild from github. When in doubt, nuke it until it glows....
Armand's answer above was the simplest solution - thanks Armand
This has been my experience - when working with the Grails in the IDE - in certain cases it's better to use the command line to issue grails commands (this was a good reminder)
Related to this, it seems better to run-app from cmd line as well (as opposed to using the IDE Project->Run As), since you can just stop the server easily with ctrl-c

Xcode 4 stuck on "Scanning for working copies"

I just archived and submitted a project. When I go back to open the project it hangs on "scanning for working copies." I can navigate around but am unable to view the project files.
It is really just a linking problem.
Select your project and make sure you have 'Identity and Type' open. This is in the right side Editor bar(toggle open and closed with 'View' button).
You can change your Location and Full Path there. You just need to check that your project is linked to the correct directories.
Hope this helps anyone.
Copy and delete the whole file and paste it in some other directory (or I guess you can put in same directory). Now open it again. I also had same problem. Actually my project was in SVN, so I deleted the directory and again checked out the entire file and opened it again. Now at least that error message is gone.
I am also new to xcode(4.3) .. sorry if my english is not good ...
Open up a more trusted Source Control App, like SourceTree, and refresh all of your working copies, then Xcode, will behave.
The problem seems to result from incorrect linking or damage to the version control repository. Other answers suggested deleting the repository or removing it from xcode under the Window -> Organise menu. I suggest you try these options and the suggestions in the other answers. However none of these worked for me and my xcode was still displaying the "scanning for working copies" message and intermittently locking up.
Deleting xcode from the Applications folder and reinstalling it from the app store then importing my project fixed the issue for me. I also suggest you dont use version control for your project unless you really need it.

Qt designer does not update the gui

Someone wrote out a GUI in Qt designer earlier and now I have to modify some small parts (i.e. add a button/functionality).
Premise:
I add the new feature/make any modification to the .ui file in Designer.
I can go to edit mode and see that this makes changes to the xml format of the .ui file
Problem:
When I build and run Qt, the old version of the .ui is what is shown (without my feature upgrades).
I tried cleaning everything and running qmake, but to no avail.
Any ideas for why this could be happening?
I had the same problem and it was solved when I disabled "Shadow Build" in "Projects" mode.
UPD:
Still receiving upvotes for this answer makes me sad for 2 reasons
it is trivial
the issue is still there after almost 5 years
I could solve this problem wihtout change Shadow Build configuration.
In my project I want to build with output files into build-ProjectName-Debug
But the QtCreator is not smart to check if are not files moc_FileName.cpp and ui_FileName.h into build directory.
This problem occur because if these files moc_FileName.cpp and ui_FileName.h are into project directory the QtCreator uses them and does not recognize any modification on .ui files.
The solution to this problem was easy to me:
Remove all moc_FileName.cpp and ui_FileName.h from project directory and Rebuild.
These files will be created into build-ProjectName-Debug and all modifications will be there.
When you change a .ui file, someone needs to run uic.exe on the file to generate a header file. For example, for a window called MyWindow.ui, this will generate a file called ui_MyWindow.h.
This is then what is used when the application is rebuilt.
You don't specify how you are building or on what OS, so it is hard to help you on that end. If you are using Visual Studios it is possible to integrate your .ui files into your projects so that when you change any .ui file, all the generated files will be recreated automatically. The same is possible if you are using .pri files.
In any case, I would run:
uic.exe -o ui_yourfile.h yourfile.ui
Please change the names of the files to the ones you are using.
uic.exe can be found in your Qt bin directory.
Then once you have the generated header file, try to find where it goes in the build directory. Then rebuild.
This is what helped me personally, add to qmake file:
UI_DIR = $$PWD
I solve this problem by cleanthenbuild.I find that ,if I checked Shadow Build,qtCreator will use the old .obj,other than generate new .obj even if the ui_xxx.h had been changed,to generate .exe when debug agin.My enviroment is qt5.5 + msvc2013.
I had the same problem and was able to solve it by deleting all the Makefiles in the build directory, then rebuilding from scratch. For some reason, these files are not deleted when you run Clean Project from Qt Creator.
Same problem for me.
Nothing works until I changed the installation from Qt 5.0.2 (MSVC 2010) to Qt 5.0.2 (mingw).
Now it is working again...wired
I experienced the same problem: no ui changes appeared after building.
The problem as mentioned above is that the ui files are not getting remade.
Unchecking shadow build solved the problem for me but only once. After that I could not see subsequent ui changes again. So I rechecked shadow build and deleted the existing shadow build folder. This works consistently now, as long as I delete all the build files. But that's lame. It should be able to detect ui changes and remake the files.
I think this should be logged as a bug in Qt Creator/Designer.
I deleted all auto gen file in source folder. when I unchecked shadow build, auto gen file was created in source folder. after when I checked shadow build, compiler only use source folder's gen file. So I deleted all auto gen file(ui_, moc_) and then ui was updated always.
In my case, the problem was caused by a rename of the .ui file. Qt Creator didn't update the #include for the header file "ui_[name_of_ui_file].h" in the .cpp file corresponding to the form. Anyway, cleaning up all the "ui_*.h" files in the shadow build folder solved the issue (I guess unchecking "shadow build" in the Project tab would produce the same effect).
Have you been playing with the system date or time or they were different from those of your fellow's computer? I was changing the time to some hours later for testing purposes (and compiling the project in the meantime) and after restoring it to current time, the compiled files were not updated because they were newer than the compilation time. Running Clean did not delete those files. Unchecking the Shadow build option only gave me crashes and an untraceable 0xc0000135 error. Deleting manually the moc_*.o and *.cpp files with future date/time from the building directory and compiling the whole project again was the solution for me.
Add the following line into .pro file
UI_DIR = $$PWD
As mentioned above, the ui files are not getting recreated. For me, the easiest solution is just hitting Rebuild instead of Build. No need to go into project submenues each time.
As long as your project is not too big, this is OK (apart from this is an anoying bug that qt has for long years now)
I had the same problem and then realized that I have modified the .pro file manually: that is I made "illegal" thing - moved mainwindow.ui under DISTFILES (by default all ui files are grouped under FORMS).
Returned back to FORMS and now everything works fine
This happened to me when I deleted elements from my form in the designer, but still had those elements referenced in the .cpp file. After I deleted those references in .cpp I was able to rebuild and the compiler stopped complaining.

Resources