Link error /Build/Products/Debug-iphonesimulator file not found
sunnymopada opened this issue · 4 comments
Steps to reproduce the behavior
Just followed the steps at given article
https://medium.com/@ywongcode/building-multiple-versions-of-a-react-native-app-4361252ddde5
Selected Beta Scheme and tried to build
Expected behavior
Build should be successful and app should be installed in simulator
Actual behavior
Getting below error
Ld /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/PlugIns/SampleExampleTests.xctest/SampleExampleTests normal x86_64
cd /Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios
export IPHONEOS_DEPLOYMENT_TARGET=8.0
export PATH="/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch x86_64 -bundle -isysroot /Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.2.sdk -L/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator -L/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/SampleExampleTests -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/AWSCore -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/AWSIoT -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/Analytics -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/Charts -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/GoogleToolboxForMac -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/HandyJSON -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/Protobuf -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/ReachabilitySwift -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SwiftyJSON -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/iBChatiOS -F/Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/nanopb -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseCore/Frameworks -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseInstanceID/Frameworks -F/Users/Sunny/Desktop/ReactNative/ibc-area-licenses/ios/Pods/FirebaseMessaging/Frameworks -F/Users/Sunny/Downloads/Xcode_9.2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Library/Frameworks -filelist /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/Objects-normal/x86_64/SampleExampleTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -mios-simulator-version-min=8.0 -dead_strip -bundle_loader /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/SampleExample -Xlinker -object_path_lto -Xlinker /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/Objects-normal/x86_64/SampleExampleTests_lto.o -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -ObjC -lc++ -framework XCTest -Xlinker -sectcreate -Xlinker __TEXT -Xlinker __entitlements -Xlinker /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/SampleExampleTests.xctest.xcent /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/libReact.a -framework Pods_SampleExampleTests -Xlinker -dependency_info -Xlinker /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Intermediates.noindex/SampleExample.build/Beta.Debug-iphonesimulator/SampleExampleTests.build/Objects-normal/x86_64/SampleExampleTests_dependency_info.dat -o /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/PlugIns/SampleExampleTests.xctest/SampleExampleTests
ld: file not found: /Users/Sunny/Library/Developer/Xcode/DerivedData/SampleExample-cbkqbphaljzpgzbqhwexgxfckfbn/Build/Products/Beta.Debug-iphonesimulator/SampleExample.app/SampleExample
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I had the same issue (and followed the same tutorial).
For now I solved it as follows (found in this stackoverflow answer):
- select your project's Test target
- select Build Settings
- Search for "Test Host"
- You should see all your configurations listed there
- Rename the <APP_NAME> parts in the paths to match the names you gave in the tutorial for each configuration.
You might also have to do this - https://stackoverflow.com/questions/26665196/ld-file-not-found-linker-command-failed-with-exit-code-1/29887473#29887473
@anje89 Thank you. I will try that.
I also had this issue @anje89 your fix has worked for now. Thanks for posting
I had this issue after renaming the display name for my iOS app. Didn't think that should break the tests but my issue was fixed after renaming the test host configurations to my new display name.