Why absolute path in git project (xCode) - xcode

i have one small project, which is hosted on bitbucket.
I just switch computer and my project is broken.
as you can see below :
clang: error: no such file or directory: '/Users/dev/iOS-dev/chanakya/Chanakya/../../../../../Al/Developer/BitBuck/Chanakya/Chanakya/leafContents.m'
clang: error: no input files
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1
All the necessary files are there but seems like project somehow stored the absolute path of files rather than relative. As I just started working on new system, I m sure all the project will be broken.
Can anyone suggest me how can I fix current problem and how can I avoid this kind of problem in future.
Any help is very much appreciated.

Related

Project ... cannot be opened because it is missing its project.pbxproj file

I recently downloaded LLVM-3.9 and built XCode project files for it with:
mkdir llvm-3.9.0.XCode # The .XCode in the name was probably a bad idea
cd llvm-3.9.0.XCode
cmake -G Xcode ../llvm-3.9.0.src/
The cmake then generated a valid looking XCode project files.
Then when I tried opening the project directory with XCode, I kept getting error:
Project .../llvm-3.9.0.XCode cannot be opened because it is missing its project.pbxproj file.
Apparently this error message is often the result of corrupt project files, but this is not the problem in my case. It seems this error can be shown due to different reasons. Here are some similar, but not identical questions that did not help me:
One about merge problems.
A question about where the file shoud be.
One about dropbox problems?
One where the problem seems to be corrupt project files
One where the problem was permissions
The solution I used was this:
cd llvm-3.9.0.XCode
cd LLVM.xcodeproj
open .
In other words, I navigated to the newly generated LLVM.xcodeproj with the shell
and used the system open command on that folder.

How to diagnose "Entering an unknown directory"

I'm getting up to speed on this QNX project with a bunch of make files I'm still getting the gist of coming from a Visual Studio background. The build output from momentics leaves much to be desired but there's one particular error that I wish there were more feedback for.
make: Entering an unknown directory
make: Leaving an unknown directory
make: *** P:\Sources_xxx\xxxx\ProjectX\x86\o: No such file or directory. Stop.
make[1]: *** [ProjectX] Error 2
We're porting code that built in VC++ so I can't just back up to the last change which introduced this error since it's all coming at once. I suppose there's something wrong with the make file but don't have the debugging skills in QNX make to get the make output to tell me what directory it's struggling with. Is the directory that's being said to be unknown the same as the ProjectX\x86\o??
So it does look like the error message pertains to the folder in question P:\Sources_xxx\xxxx\ProjectX\x86\o, this is apparently the unknown directory, which is basically a directory that does not exist on the file system. From our build setup we were expected to commit to source control the output folders that are generated according to the Build Variants specified in the project settings, which in our case were X86.
This wasn't clear to us who are new on the team working with QNX since coming from Visual Studio such intermediate folders get automatically created and are not expected to be checked into source control. The thing that obscured this too is that the folder existed on my developer system when I created the new QNX project, but not being in source control was not found on the Build Server which is where the error was seen.

How to make Xcode project folder location independent

There must be something wrong with the way I build my project.
I noticed that when I move my Xcode project folder from a directory inside my document folder to the desktop for example, it doesn't build when it previously does! In my case this time, somehow it can't find the Core Plot sub project.
It says:
clang: error: no such file or directory: '/Users/t2wu/Library/Developer/Xcode/DerivedData/HRM-fxvjidgvnxghjogeevqdzlccbulu/Build/Products/Debug-iphonesimulator/libCorePlot-CocoaTouch.a'
Any pointer appreciated.
For your current error clean should help
Use macro $(SOURCE_ROOT) for any third party library.

sigh... Accidentally hit "add files to project" on entire project folder & started a loop of repeatedly duplicating the project within itself

Wow... tail between legs...
So I clicked "add files to project" in Xcode. My entire project folder came up selected by default, as it usually does. I changed my mind and went to click "cancel", but accidentally clicked "add"... so it basically created this loop of continually adding my project folder inside my project folder... inside my project folder etc.. until it finally errored & stopped. (brought my project folder from about 25Mb to almost 3 gigs!!!
I went into my actual project folder (in finder, not in xcode) and deleted the duplicate folder that contained all the other duplicates. But now when I try to build, I get all kinds of errors. This may be the most embarrassing thing I've ever done. I have a repo backup from 5 days ago, but I'd rather not lose 5 days worth of work. Can someone please help me :( 1 billion internet points to whoever can help me so i can keep working tonight!
here are the errors:
Lipo Error:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/lipo:
can't open input file:
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-rtgmnzqeqhksvjbmtqtvnaudfgr/Build/Intermediates/appname.build/Debug-iphoneos/appname.build/Objects-normal/armv7/appname
(No such file or directory)
Apple Mach-O Linker Error: ld: 5 duplicate symbols for architecture
armv7 clang: error: linker command failed with exit code 1 (use -v to
see invocation)
Dsymutil Error: GenerateDSYMFile
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app.dSYM
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app/appname
cd /Users/Daniel/appDirectory
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil
/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app/appname
-o /Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app.dSYM
error: unable to open executable
'/Users/Daniel/Library/Developer/Xcode/DerivedData/appname-gahmnzqeqhksvjbmtqtvnauibzrx/Build/Products/Debug-iphoneos/appname.app/appname'
I Don't know whether i will be able to make you understand or not but i have tried this weired thing just for you and I have got the same error.
Then i found solution for myself, may be it will also help you.
Go to Build Phase -> compile source and then select all the files you see with postioning folder inside a folder like I have shown in screen shot below. you can see the main.m file inside slider/slider/slider..... where slider is my main project folder.
just check for it and press the minus button on the bottom . this will delete all the duplicate files from the finder. same for the images can be done like i have shown in the screen shot.
Then go to your project's finder and just delete the first folder which contain all the folders and project will run smoothly.
I have done this hope this will help you also. (please have a backup of your project before doing it ) :)

How is the Xcode "Copy Bundle Resources" build phase setenv PATH value derived?

On my MacBook Pro (running 10.6.2) an Xcode (3.2.1) project build is failing with the error:
copyplist failed with exit code 127
When I examine the build results I see that the copyplist script is reporting:
sh: plutil: command not found
Earlier in the build results for CopyPlistFile I see the line:
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:Developer/usr/bin"
The plutil executable is actually located in /usr/bin
On my desktop machine with the same O/S and Xcode versions the project build succeeds and in the build results I can see that the PATH also has appended to it ":/usr/bin:/bin:/usr/sbin:/sbin"
How do I go about correcting the problem in Xcode on my MBP?
UPDATE
I originally discounted the SO question where is $PATH set in xcode?, but since someone else also referred me to that question I'm including my results using the suggestions found there.
1) On the working machine there is no ~/.MacOSX directory. On the machine with the error the value for the PATH key in the environment.plist file in that directory was empty. I removed both the file and the directory to no avail.
2) Since the script with the error comes from the "/Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources" directory I presumed changing that file wasn't likely to be the appropriate correction.
3) The .profile on the machine with the error added two directories to the PATH that were not present in the PATH on the working machine. Since there was also a fifth directory in the PATH on both machines that wasn't reflected in the build results on the working machine I figured this wasn't likely to be the source of the problem, but I went ahead and made the .profiles match on both machines anyway. The build error did not go away.
4) There are no environment variables set for the executable.
Further suggestions?
Using full paths in your script would be the simplest way. Searching would be another where is $PATH set in xcode?

Resources