So for one of my classes, we are supposed to refactor this project from last quarter that was left in a pretty bad state.
So we are trying to write unit tests for the project, but they used an old version of Xcode, so we had to re-add the XCTest framework to "Link Binary With Libraries".
I accidentally added the MacOSX version of it the first time, and noticed my error. I removed the OS X version from the linker, and added the iPhoneSimulator version to it. It kept giving me the same error. So I removed all XCTest.framework files from the Build Phases, and it gave me an error about OCMock (which is a totally different problem that I'm not concerned about right now), which means it knows it's gone. So I then tried re-adding XCTest.framework to my test target, making sure it was the iOSSimulator version, and it gives me the same error about it being the Mac OS X version. I have tried restarting Xcode and did correctly that I did before but that did not work. Below is the full output from the error.
Ld /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator/HenryTests.xctest/HenryTests normal x86_64
cd /Users/MY_USERNAME/Git/JrProj-1415-Mike/Code/iOS/Henry
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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/clang -arch x86_64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk -L/Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator -L/Users/MY_USERNAME/Git/JrProj-1415-Mike/Code/iOS/Henry -F/Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/MY_USERNAME/Git/JrProj-1415-Mike/Code/iOS/Henry -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.2.sdk/Developer/Library/Frameworks -filelist /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Intermediates/Henry.build/Debug-iphonesimulator/HenryTests.build/Objects-normal/x86_64/HenryTests.LinkFileList -bundle_loader /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator/Henry.app/Henry -Xlinker -objc_abi_version -Xlinker 2 -framework XCTest -ObjC -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework XCTest -lOCMock -framework UIKit -framework Foundation -framework Firebase -Xlinker -dependency_info -Xlinker /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Intermediates/Henry.build/Debug-iphonesimulator/HenryTests.build/Objects-normal/x86_64/HenryTests_dependency_info.dat -o /Users/MY_USERNAME/Library/Developer/Xcode/DerivedData/Henry-ayqkhtmgjufxaagawvfjprhgilji/Build/Products/Debug-iphonesimulator/HenryTests.xctest/HenryTests
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
In case anyone come across this problem too, pretty much the only solution is to make a new project, and add all the files to that new project. I've talked to some professionals in iOS development, and they could come up with no other solution. I think it has something to do with the project being from a pretty old version of Xcode, and the new XCTest framework being pretty new. Good luck to you if you come across this too.
Related
I have been struggling to get schemes on iOS to work for my react native project reliably.
I followed the suggestions at https://medium.com/#ywongcode/building-multiple-versions-of-a-react-native-app-4361252ddde5, as well as tried using react-native-schemes-manager, which worked 1 time, but couldn't be duplicated onto another computer. I get all kinds of different problems, from libraries not found, to duplicate declarations and other problems. I have tried many many suggestions and none of them seem to work. I believe the problem all have to do with the build paths or search paths, but I am not expert enough in Xcode to figure out what is going wrong. I use quite a number of 3rd party libraries, including Code Push, Fabric, RNConfig, ImageCropPicker amongst others.
So finally I have decided to revert everything and start again from just the basic Debug and Release config, and have deleted all the additional configs and schemes. So, by doing this everything works (Run, and Archive).
Next, I just created a build config by duplicating the Release config, and called it Staging. Next I edited the working scheme release to use the Staging config for archiving, and ran the archive. This fails with the following message:
/opt/react/XXX/ios/XXX/AppDelegate.m:11:9: fatal error: 'CodePush/CodePush.h' file not found
#import <CodePush/CodePush.h>
Before I went through this exercise of deleting all the configs, if I used the previous Staging config in the same scheme, it this other error:
Showing Recent Messages
Ld Build/Intermediates/ArchiveIntermediates/XXX/IntermediateBuildFilesPath/XXX.build/Staging-iphoneos/XXX.build/Objects-normal/arm64/YYY.St normal arm64
cd /opt/react/XXX/ios
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos -L/opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Staging-iphoneos/QBImagePickerController -L/opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Staging-iphoneos/RSKImageCropper -L/opt/react/XXX/ios -F/opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos -F/opt/react/XXX/ios/Pods/Crashlytics/iOS -F/opt/react/XXX/ios/Pods/Fabric/iOS -filelist /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/IntermediateBuildFilesPath/XXX.build/Staging-iphoneos/XXX.build/Objects-normal/arm64/YYY.St.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -miphoneos-version-min=8.0 -Xlinker -object_path_lto -Xlinker /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/IntermediateBuildFilesPath/XXX.build/Staging-iphoneos/XXX.build/Objects-normal/arm64/YYY.St_lto.o -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos -Xlinker -final_output -Xlinker /Applications/YYY.St.app/YYY.St -fobjc-arc -fobjc-link-runtime -ObjC -lQBImagePickerController -lRSKImageCropper -lc++ -lz -framework Crashlytics -framework Fabric -framework Photos -framework QuartzCore -framework Security -framework SystemConfiguration -framework UIKit -weak_framework CoreFoundation -lz /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libimageCropPicker.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTPdf.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRNFetchBlob.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTVideo.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRNVectorIcons.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTPushNotification.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRNSound.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libReact.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTAnimation.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTActionSheet.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTGeolocation.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTImage.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTLinking.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTNetwork.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTSettings.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTText.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTVibration.a /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/BuildProductsPath/Release-iphoneos/libRCTWebSocket.a -lRNAudio -lRCTCamera -lRNDeviceInfo -lCodePush -lLRDRCTSimpleToast -lRCTOrientation -lPods-XXX -lReactNativeConfig -lRNPhotoView -lReact -lyoga -lcxxreact -ljschelpers -lRNSensitiveInfo -Xlinker -dependency_info -Xlinker /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/IntermediateBuildFilesPath/XXX.build/Staging-iphoneos/XXX.build/Objects-normal/arm64/YYY.St_dependency_info.dat -o /opt/react/XXX/ios/Build/Intermediates/ArchiveIntermediates/XXX/IntermediateBuildFilesPath/XXX.build/Staging-iphoneos/XXX.build/Objects-normal/arm64/YYY.St
ld: library not found for -lPods-XXX
clang: error: linker command failed with exit code 1 (use -v to see invocation)
There are so many variations to the errors that I have had with this, so I can't figure out what I am doing wrong.
Have already set Header Search Paths, Framework Search Paths and Library Search Paths to include $(BUILD_DIR)/Release$(EFFECTIVE_PLATFORM_NAME)
I always clean project before trying another variation, but no luck...
Help!!!
I think question has an answer here:
Why does exact copy of Xcode Build Configuration fail?
I wonder if this is caused by a bug in React Native - this looks similar to what you are reporting:
https://github.com/facebook/react-native/issues/19929
If it is, maybe you can chip in and we'll get more attention towards this problem.
I cannot compile my project for the simulator .
I get Apple Mach-O-Linker error.I cant understand how to solve the issues.I am using xcode 5.0.1.
Please help me any body.
Thanks in advance.
Ld /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator/ClassifiedDetails.app/ClassifiedDetails normal i386
cd /Users/murthych/Desktop/ClassifiedDetails
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator -F/Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -filelist /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Intermediates/ClassifiedDetails.build/Debug-iphonesimulator/ClassifiedDetails.build/Objects-normal/i386/ClassifiedDetails.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework XCTest -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Intermediates/ClassifiedDetails.build/Debug-iphonesimulator/ClassifiedDetails.build/Objects-normal/i386/ClassifiedDetails_dependency_info.dat -o /Users/murthych/Library/Developer/Xcode/DerivedData/ClassifiedDetails-elseirogpshyhmffphsiejgydphd/Build/Products/Debug-iphonesimulator/ClassifiedDetails.app/ClassifiedDetails
Mach-O-Linker error message
building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) "
XCTest.framework needs to be linked only to the unit test target in your project. It should not be added to the UI application target.
What I have found is when adding XCTest.framework Xcode adds extra \ to Framework Search Paths
\"$(SDKROOT)/Developer/Library/Frameworks\"
\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"
$(DEVELOPER_FRAMEWORKS_DIR)
This causes linker issue,
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/XCTest.framework/XCTest' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To resolve this issue in XCode 5.1 goto the main ProjectWindow, Tab Build Settings -> Section Search Path -> Framework Search Paths and edit to remove \ appearing the paths.
Hope that helps!
Deleting the test target and creating a new one and then copying the tests over can fix this.
I suggest you to use xcode 5.02 stable version and then hopefully these Mac-O Linker errors will be resolved.same problems I am facing too before installing xcode 5.02.
I've been creating some app for some months, and suddently Xcode 5 doesn't want to build it. It just complains with the following error.
Ld build/Debug-iphonesimulator/appname.app/appname normal i386
cd /Users/myname/proyectos/appname/dev/iOS/appname
setenv IPHONEOS_DEPLOYMENT_TARGET 5.1
setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.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/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/myname/proyectos/appname/dev/iOS/appname/build/Debug-iphonesimulator -L\"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/FlurryAnalytics\" -L\"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/SmartADServer\" -L\"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/TestFlight\" -F/Users/myname/proyectos/appname/dev/iOS/appname/build/Debug-iphonesimulator -F/Users/myname/proyectos/appname/dev/iOS/appname/appname/External -filelist /Users/myname/proyectos/appname/dev/iOS/appname/build/appname.build/Debug-iphonesimulator/Appname.build/Objects-normal/i386/appname.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.1 -weak_framework AdSupport -framework Security -framework MessageUI -framework Twitter -framework CoreLocation -weak_framework CoreMotion -framework AudioToolbox -framework AVFoundation -framework MediaPlayer -framework SystemConfiguration -framework MobileCoreServices -lz -framework CFNetwork -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -lTestFlight -framework comScore -lFlurry -Xlinker -dependency_info -Xlinker /Users/myname/proyectos/appname/dev/iOS/appname/build/appname.build/Debug-iphonesimulator/Appname.build/Objects-normal/i386/appname_dependency_info.dat -o /Users/myname/proyectos/appname/dev/iOS/appname/build/Debug-iphonesimulator/appname.app/appname
ld: warning: directory not found for option '-L"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/FlurryAnalytics"'
ld: warning: directory not found for option '-L"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/SmartADServer"'
ld: warning: directory not found for option '-L"/Users/myname/proyectos/appname/dev/iOS/appname/appname/External/TestFlight"'
ld: library not found for -lTestFlight
clang: error: linker command failed with exit code 1 (use -v to see invocation)
If I understand it ok, it complains about testflight, but I haven't changed anything about it in weeks. It compiled it perfectly.
I have to say I've tried adding Adobe ADMS tracking library onto the project (but then undoing its addition). And then after that, linker errors appear.
Any hint? I'm COMPLETELY at lost and frustrated. Are my project files corrupt maybe? (Let's hope not!!) Any hope to recover them in such case?
Greetings
"Problem solved".
Apparently it seemed (as ahwulf said, and I suspected) that my Project paths/libraries/headers where somehow corrupt inside Xcode 5.
What was my solution? After more additional tests, I just physically removed some of my apparently conflicting libraries (testflight, flurry, etc...) from the project (and ALSO from disk) and started compiling, waiting for the obvious compilation errors that would appear.
When they appeared, I just re-added the files XCode asked me to add (one file/library at a time), and then one by one, all these errors started to slowly disappear.
My original linking error ALSO disappeared, so my project builds again.
I have the feeling I don't really know what I did, but "it worked".
Something that worked for me in this situation was to remove 'libTestFlight.a' from my Link Binary With Libraries section in the Build Phases and clean my project then redrag it into this section from my File tree. (Of course if you want to use Testflight in your app make sure that you also have libz.dylib as a framework and the associated TestFlight files are also included in your project such as TestFlight.h, TeshFlight+AsyncLogging.h and TestFlight+ManualSession.h - if libz.dylib gets deleted and then readded it can cause this error). Good luck code warriors!
XCode 5 appears to have a bug where it spontaneously adds an extra absolute path in build settings. Bitten me a couple of times already.
I had the identical error for a very different reason.
Having upgraded from TestFlight 1.2.4 to TestFlight 2.0.2, the build worked on my own machine, but a nightly build on a different machine failed.
The simple reason that the library wasn't found was that it hadn't been committed. Our .gitignore is set to ignore .a files, so libTestFlight.a had not been included. Opening the project in Xcode made this more obvious than the command line build log.
git add -f sorted this out.
I've faced the exact same problem with adding TestFlight 2.0.2. And it was also conflicting with Flurry (and some others). Removing (reference!) and re-adding all conflicting libraries with TestFlight being last helped me. But firstly don't forget to delete Library Search Paths.
I am thinking of rebuilding the project from scratch which I would like to avoid, so I am asking for help.
When trying to build the project on release I get the following link error:
Ld
/Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Products/Release-iphoneos/MyStreamPlayer.app/MyStreamPlayer
normal armv7
cd /Users/MAS/iphoneApps/AlfsreamPlayer/MyStreamPlayer
setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
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/clang++
-arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk
-L/Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Products/Release-iphoneos
-L/Users/MAS/iphoneApps/AlfsreamPlayer/MyStreamPlayer -L/Users/MAS/iphoneApps/AlfsreamPlayer/MyStreamPlayer/../build -F/Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Products/Release-iphoneos
-filelist /Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Intermediates/MyStreamPlayer.build/Release-iphoneos/MyStreamPlayer.build/Objects-normal/armv7/MyStreamPlayer.LinkFileList
-Xlinker -map -Xlinker /Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Intermediates/MyStreamPlayer.build/Release-iphoneos/MyStreamPlayer.build/MyStreamPlayer-LinkMap-normal-armv7.txt -dead_strip -finalize -prefinalized-library libViewRightWebiOS.a -finalized-product /Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Products/Release-iphoneos/MyStreamPlayer.app/MyStreamPlayer
-libVideoWebiOS -fobjc-link-runtime -miphoneos-version-min=6.0 -framework Foundation -framework UIKit -framework CoreGraphics -framework MediaPlayer -framework CFNetwork -libVideoWebiOS_debug -libVideoWebiOS -o /Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Products/Release-iphoneos/MyStreamPlayer.app/MyStreamPlayer
clang: error: no such file or directory:
'/Users/MAS/Library/Developer/Xcode/DerivedData/MyStreamPlayer-auylvnjdlrkfpvaxnulcaadbfhwl/Build/Products/Release-iphoneos/MyStreamPlayer.app/MyStreamPlayer'
No problem with debug mode. The project runs fine on another computer on xcode 4.5.1. I thought the xcode version could be the problem but when I tried it on another computer with xcode 4.5.1 I got the same problem.
The project uses a library libVideoWebiOS. I have it on the Build Phases -> Link Binary With Libraries. Any idea what produce could this issue? Here is the screenshot of build settings -> architectures.
There are lot of suggestions to Change "Build Active Architecure Only" to Yes but unfortunately that didn't work for me.
From your comment, it seems you are having multiple targets in your project. If you are using any third party libraries or wrapper classes, don't import the project. Add only the required files and folders you want. I don't know how to make the project in release mode which having multiple targets. But making your project with one target might solve your problem. Remove the references of your third party project.xcodeproj and add the source files what are all you needed in that project. Hope it helps.
Ron is correct, you must use the Finalizer before you can create a release build. Be sure you have Xcode closed for the finalizer to work.
I am attempting to profile (as in gcov style profiling) my unit tests for an Xcode 4.2 project on Snow Leopard (10.6) linking against iOS 5.0. I have turned on -fprofile-arcs -ftest-coverage and I'm linking against -lprofile_rt. Compiling with LLVM 3.0.
My target is a static library that is being tested by a unit test bundle.
Everything compiles fine, but in the link step for the unit test bundle I get:
ld: in Foo/DerivedData/Foo/Build/Intermediates/Foo.build/Debug Profile-iphonesimulator/UnitTests.build/Objects-normal/i386/TestUtilities.o, in section _DATA,_const reloc 0: GENERIC_RELOC_SECTDIFF missing following pair for architecture i386
This is the actual link step:
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/opt/local/bin:/usr/local/git/bin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -bundle -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk "-LFoo/Build/Products/Debug Profile-iphonesimulator" -L/Developer/usr/lib "-FFoo/Build/Products/Debug Profile-iphonesimulator" -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/Developer/Library/Frameworks -filelist "Foo/DerivedData/Foo/Build/Intermediates/Foo.build/Debug Profile-iphonesimulator/UnitTests.build/Objects-normal/i386/UnitTests.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fprofile-arcs -ftest-coverage -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -lFoo -framework Foundation -framework SenTestingKit -lprofile_rt -o "Foo/DerivedData/Foo/Build/Products/Debug Profile-iphonesimulator/UnitTests.octest/UnitTests"
Anyone have any ideas why I can't link?
Turns out that it appears to be a bug in the compiler. My TestUtilities.m file was quite complex (with a lot of STAssertEquals). The STAssertEquals macro expands to quite a complex chunk of code with a #try/catch block. By defining my own STAssertEquals that was slightly less featured but that didn't have an #try block, it simplified my generated code enough that the compiler/linker was happy with it. I'll file an appropriate radar.