xcode searches for prefix.pch file in wrong directory - ios7

i made a xcode project and changed the name of the folder in xcode as well as in finder. then i proceeded to relink them via the method shown here: Renaming xcode 4 project and the actual folder
so originally the folder was weatherScan2 which i renamed to weatherScan and xcode shows that there are no issues. However when i click build, there's a clang error that says:
no such file or directory: '/Users/user/Documents/Xcode/WeatherScan/WeatherScan2(thisis the folder that i renamed to weatherScan)/WeatherScan-Prefix.pch
clearly it should be looking for the pch file in weatherscan as there is no longer any weatherscan2 folder in existence. How should i redirect this?
i already tried deleting the pch file from xcode and then readding it but the same thing happens. what part of xcode is trying to look for the pch file in the old place and not the new renamed folder? all the other files seems to be working fine.

ok, i realized the issue was in the target/build setting section where it still shows my app looking for the info and pch files in weatherScan2 folder. i edit that and everything works.

Related

Copied Xcode Project won't build

OS X Version 10.10.5
Xcode version 7.2.1
Very simple steps, yet Xcode can't fathom what to do when you duplicate a folder that contains an Xcode project.
Start with Xcode CLOSED.
Start with an Xcode project that builds and runs perfectly.
Go to Finder window and right click on the directory that contains the buildable Xcode project and hit "Duplicate"
New directory is created, called "SomeProject copy"
Go into this new directory and double-click on the SomeProject.xcodeproj file to open it in Xcode.
Bam... enjoy your build errors.
In my case, it's complaining about an enum.
Tried deleting derived data folder (did so directly using finder)
Tried super-cleaning the build folder by holding down the option key.
Tried removing and re-adding complained about file that contains errors.
Tried changing path to file in Xcode File Inspector from "Relative To Group" to "Absolute Path"
I should also point out that either Finder -> Duplicate doesn't actually do what it says it does. Neither does Finder -> Copy, ~OR~ Xcode for some reason has now adopted not only the original source location as where to get its build files, but also the new location, hence the "Redefinition" error. I noticed that if I open the "copied" project and edit a file, then go back to my original project in an entirely different folder, the file is changed THERE.
And my paths (according to Xcode File Inspector), are RELATIVE TO THE PROJECT IN QUESTION. So in other words, ProjectAAA's files are pointed to the path under ProjectAAA's directory, and the same with copied project, ProjectBBB's files.
So somehow, the copy/duplicate is refusing to actually copy/duplicate.
Any ideas how to solve this?
Per John Elemans comment, moving my original project then revealed in the copied Xcode project a number of build paths and issues that needed resolving. I fixed those, and it worked as expected.
I solved this issue as follows:
After duplicating the root folder of the project, open the podfile of the duplicated project:
Podfile
then comment all the previously added pods by adding "#":
Commented Pods
hit CTRL + S in order to save the changes
Open the terminal and change the directory to the folder of the duplicated project and then perform: "pod install". Yes it will delete all the pods but don't worry we will install again in the next step
Pods deletion
Open again podfile and uncomment the previously commented pods:
Uncommented pods
hit CTRL + S to save the changes
Open the terminal and change the directory to the folder of the duplicated project and then perform "pod install". it will install again all the pods:
Pods installation
Finally, run the Project and it should run without any problem.

XCode copies only changed xib files to the target binary

In my project I have almost 30 xib files located in an en.lproj folder and henced listed as english localization in XCode. When I compile my project, however, these xib files are not copied to the target folder (Resources/en.lproj) unless I modify them. All other resources are always copied, regardless of their change state. Of course all the xib files are in the "Copy Bundle Resources" build phase (along with a lot of other resources like images).
This behavior gives me some trouble, e.g. when I manually remove the .app from the DerivedData folder. The app is rebuilt completely on next build in XCode, only the xibs are all missing until I touch all of them.
How can I solve this problem and make XCode always copy my xib files too?
Seems to have been fixed with one of the latest XCode versions. I just checked with XCode 7.1.1 and the nibs are copied regardless of their change status, if they don't exist in the target folder already.

Xcode 6 beta build fails after moving -Bridging-Header objective-c swift xcode6

I am facing build fail error after moving Bridging-Header
objective-c swift on xcode6.
Before I moved header file, it had been working fine.
The error shows header file not exist. The header file path remains still old path in error log. I tried build clean, but still old path remains.
How can clean the objc-header-path?
You need to update the path in your project's Build Settings to point to the new bridging header location.
Click your target and then click 'Build Settings' then search for Objective-C Bridging Header
You'll find the path to the bridging header in your target's Build Settings, under "Swift Compiler - Code Generation"/"Objective C Bridging Header".
I tried with Xcode6.1-Beta, as well.
But still impossible to update the objective-c header path.
I don't know where the configuration file is. I gave up to figure out.
Finally, I deleted the target xcode project and recreated new project.
Now it is working.
Yes it's possible.
Delete the .h file
Clear the path at Objective-C Bridging Header
Create new Objective-C File
Name your header file to the same name as before (popup will ask you to create new header file)
Goto File > Project Settings > Data Location
Make sure your path is correct and press "Done"
Your app should run again pointing to the right location of the header file and delete the files ModuleCache
Happens to me many times when i move app folder around.
I had a workspace that I was using when I had the same thing happen. I moved my project to a different folder. Despite having a relative path on my bridge headers, it was still referencing the old location when building and threw an error.
Here's what I did to fix this:
Close the workspace
Open the .xcworkspace file using TextWrangler. TextWrangler allowed me to navigate the package to /xcuserdata/[username].xcuserdatad/UserInterfaceState.xcuserstate. I did a search for the old path and found it. Make the change to the new location of the header file.
This by itself didn't fix it. After cleaning and building, the old value showed back up! Then I deleted the Build folder. It has a ModuleCache that I think was holding on to the old value as well.
After doing this, my project picked up my new value and I was able to build the project. I'm not certain step 2 is necessary. But it did store the old value in there.
In my case, I changed the path from relative path to absolute path and solved.
like
From:
project_name/project_name-Bridging-Header.h
To:
$(SRCROOT)/project_name/project_name-Bridging-Header.h

File not found error in xcode

I have imported the folder containing SUPQueueConnection.h to the project and to the project root too. Still it is showing the same error SUPQueueConnection.h file not found.
And we imported all such needed .h and .m files to the project root.
Is there any other way for doing it?
Can anyone please help me in solving this problem?
In project navigation bar of your project check the folder you imported that it actually contains SUPQueueConnection.h file or not and if it is there try to import header file in the class in which you are using "SUPQueueConnection.h" file.Also if project is showing SUPQueueConnection.h file then right click on this file and click "Show IN Finder" option to see where actually the file is.Make sure it is copied in project folder.
If it does not solve the problem try deleting this file and drag and drop SUPQueueConnection.h again in project directly and make sure while copying on target your project is check marked.
Have you made sure that the files that aren't found are actually in your Xcode project? Make sure you can see the files somewhere in the sidebar. I've never actually tried it, but I don't think you can simply access files in the project directory root, they must be in your project. Xcode has changed since I used it last (been doing other things) but I think you can still add files by right clicking somewhere in your sidebar, also unless its changed you can add external files using a button in the file menu

Reading File to Frameworks of Xcode

I removed a file from the Framework section of my Xcode application and now I want to add the file back. However when I try to add the file back I get the following alert.
Could not copy /Users/brian/Downloads/iphone-exif-0-9.1(1)/Release-simulator-iphonesimulator/libiphone-exif.a to /Developer/CS193/GraffitiMap/libiphone-exif.a.
What is going on here?
When you add a file in you project, you can either copy it in you project or just reference the file somewhere else on your hard drive.
When you removed the file from you project, you didn't remove it from you project folder. Xcode can't write at that path since there's already a file, and gives you an error.
Just remove the file that's already in your project folder from the Finder.