I am trying to implement admob in my app, so that it can display ads when iAd can't or won't. I am getting this error and I've tried everything that I could find online to fix it. Nothing seems to work.
Framework not found GoogleMobileAds
clang: error: linker command failed with exit code 1 (use -v to see invocation)
To implement admob, I downloaded the latest GoogleMobileAdsSDK and unzipped it. I then went to Linked Frameworks and Libraries and added it there. I had to browse the location to which I unzipped it to get it. I also saw something online about adding -ObjC to Linking > Other Linker Flags, and I did that. When I build it, I get the error. If I remove it from Linked Frameworks and Libraries, my app will once again compile.
This is the full linker error:
Ld /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator/SampleProject.app/SampleProject normal x86_64
cd "/Users/Scott/Documents/Production Code/iOS7/Production/SampleProject"
export IPHONEOS_DEPLOYMENT_TARGET=9.0
export PATH="/Applications/Xcode 7/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode 7/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode\ 7/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode\ 7/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk -L/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator -F/Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator -F/Users/Scott/Documents/Production\ Code/iOS7/Production/SampleProject -filelist /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -mios-simulator-version-min=9.0 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -L/Applications/Xcode\ 7/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject.swiftmodule -framework GoogleMobileAds -framework iAd -Xlinker -dependency_info -Xlinker /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Intermediates/SampleProject.build/Debug-iphonesimulator/SampleProject.build/Objects-normal/x86_64/SampleProject_dependency_info.dat -o /Users/Scott/Library/Developer/Xcode/DerivedData/SampleProject-bkpjdyfrfcdilmegqcqkdlsewsiu/Build/Products/Debug-iphonesimulator/SampleProject.app/SampleProject
Any ideas on this?
I was able to solve the same problem with the following code.
Remove your GoogleMobileAds framework from your project. And add it again
Add this to the Library Search Paths in Build Settings and make sure you select recursive, delete other library paths which might be absolute paths.
$(PROJECT_DIR)
May be it will help you.
This happened to me on two of my apps and caused me hours of frustration.
I will write down the process that I took:
Delete all GoogleADMOB frameworks from Xcode project
Move the files to the trash
Navigate to
/Users/jeremy/Library/Developer/Xcode/
and delete "DerivedData". Xcode will regenerate this on the next execution of your project.
Empty Trash
Force quit Xcode and any simulators
Restart Computer
Download a new SDK from google
Download GoogleADMob SDK
I did try to do this by avoiding to redownload the SDK but had no success.
Place them into your project as you had them before and run.
I have seen many different solutions, but they personally did not work for me. I really hope this helps anyone else who comes across this issue. It will save you the time and stress.
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'm trying to setup cocoapods with a project in order to use the STPrivilegedTask class and have been running into the following error:
Ld ProductBuilder.app/Contents/MacOS/ProductBuilder normal x86_64
cd /Users/zach/Dev/Code/ProductBuilder
export MACOSX_DEPLOYMENT_TARGET=10.7
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -L/Users/zach/Dev/Code/ProductBuilder -F/Users/zach/Dev/Code/ProductBuilder -filelist /Users/zach/Dev/Code/ProductBuilder/Build/Intermediates/ProductBuilder.build/Debug/ProductBuilder.build/Objects-normal/x86_64/ProductBuilder.LinkFileList -mmacosx-version-min=10.7 -ObjC -lSTPrivilegedTask -framework Security -fobjc-arc -fobjc-link-runtime -framework QuartzCore -framework OpenGL -framework Cocoa -lPods -Xlinker -dependency_info -Xlinker /Users/zach/Dev/Code/ProductBuilder/Build/Intermediates/ProductBuilder.build/Debug/ProductBuilder.build/Objects-normal/x86_64/ProductBuilder_dependency_info.dat -o /Users/zach/Dev/Code/ProductBuilder/ProductBuilder.app/Contents/MacOS/ProductBuilder
ld: library not found for -lSTPrivilegedTask
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am able to use the STPrivilegedTask class in my code without any issues, it's just that I do not build - even without adding any STPrivilegedTask code, the app does not build.
Some other notes:
I am opening the project using the xcworkspace file.
STPrivilegedTask does show up in the Pods section in Xcode, and has it's source code there, so that seems OK. As I said, I can also reference this class in code, so I think it's grabbing the class correctly.
The app I am adding cocoapods to is relatively old, but has not used cocoapods before, so this is a fresh install.
I am using cocoapods version 0.39.0
Please let me know if you have any ideas!
Thank you,
Zach
This was fixed by changing my Per-configuration Build Products Path setting to:
$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME).
I tested the STPrivilegedTask pod in a new project without any issues, so I figured it must be something with my project setup. The project is somewhat of a legacy app, and has gone through some odd phases/cycles, so I can't explain why the Build Products Path was set to anything but that (the expected/normal value I think...)
Anyways, it builds OK now - hopefully this helps someone else!
I'm creating a weather app which gets information from a web site. Everything was fine the last time I was coding (last night), I was able to compile and run the simulator with no errors. Just today when I launch the same project, without changing anything, I got a "Apple Mach-O Linker Error". Could you all help with this please?
Here's the details of the error:
Ld /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator/Haze\ Meter.app/Haze\ Meter normal x86_64
cd "/Users/Allister/Documents/XCODE/Haze Meter"
export IPHONEOS_DEPLOYMENT_TARGET=8.3
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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -L/Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator -F/Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator -filelist /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze\ Meter.build/Debug-iphonesimulator/Haze\ Meter.build/Objects-normal/x86_64/Haze\ Meter.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -add_ast_path -Xlinker /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze\ Meter.build/Debug-iphonesimulator/Haze\ Meter.build/Objects-normal/x86_64/Haze_Meter.swiftmodule -mios-simulator-version-min=8.3 -Xlinker -dependency_info -Xlinker /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze\ Meter.build/Debug-iphonesimulator/Haze\ Meter.build/Objects-normal/x86_64/Haze\ Meter_dependency_info.dat -o /Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Products/Debug-iphonesimulator/Haze\ Meter.app/Haze\ Meter
and at the bottom:
ld: file too small (length=0) file '/Users/Allister/Library/Developer/Xcode/DerivedData/Haze_Meter-dkjjcmjehyitmcbhkcbujnsrhwpu/Build/Intermediates/Haze Meter.build/Debug-iphonesimulator/Haze Meter.build/Objects-normal/x86_64/ViewController.o' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've checked other "Apple Mach-O Linker Error" on StackOverflow but they seem to be having a different "ld" with mine, albeit the same "clang".
Try a full rebuild / clean. It's possible that the a previous build has been abnormally aborted, leaving the ViewController.o file corrupted or zero-size.
To clean: In Xcode "Product" menu, select "Clean" (shortcut: Cmd+Shift+K)
To rebuild: In Xcode "Product" menu, select "Build" (shortcut: Cmd+B)
If it doesn't work: In Xcode "Product" menu, hold down Option key, and select "Clean Build Folder"
reference from HERE.
You don't (usually) have to clean, just open the file it mentions and resave it so that xcode thinks it changed. Then you can just do an incremental build (much faster).
I had the same problem. It turned out to be that one of my frameworks I added externally could not be found. To fix it I removed the reference to it, re downloaded it, then re added it to my project.
For me it was because of a empty UINavigationController stranded in storyboard.
Hope this helps the needy ones.
in my case.i get this error in a framework which is accessed by cocoapods. i fix this error by run cmd 'pod cache clean' and then clean and rebuild project.
I had the same issue with AppCode. Invalidate Caches / restart didn't help. Fixed issue by manually deleting Library/Caches/AppCodeXXXX/DerivedData folder.
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.
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.