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.
Related
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 have an iOS project with Google AdMob SDK installed using cocoa pods. When I started the project, the name of the project is called MAPPER. Then I renamed the project to GLITTER in Xcode. Xcode changed the name in almost all places except for cocoa pods. I had to rename in manually as in
target 'Glitters' do
pod 'Google-Mobile-Ads-SDK', '~> 7.0'
end
target 'GlittersTests' do
end
I have to manually rename it. Then POD INSTALL worked fine. But my compile is failing with linker error as below
ld: library not found for -lPods-Mapper
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Full log message
Ld /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator/Glitters.app/Glitters normal x86_64
cd /Users/BharathMBA/iOS/Swift/Mapper
export IPHONEOS_DEPLOYMENT_TARGET=7.0
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.1.sdk -L/Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator -F/Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator -F/Users/BharathMBA/iOS/Swift/Mapper/Pods/Google-Mobile-Ads-SDK/GoogleMobileAdsSdkiOS-7.0.0 -filelist /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-Glitters-Google-Mobile-Ads-SDK -framework AVFoundation -framework AudioToolbox -framework CoreGraphics -framework CoreTelephony -framework EventKit -framework EventKitUI -framework GoogleMobileAds -framework MessageUI -framework StoreKit -framework SystemConfiguration -weak_framework AdSupport -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator -Xlinker -force_load -Xlinker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a -Xlinker -add_ast_path -Xlinker /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters.swiftmodule -mios-simulator-version-min=7.0 -lPods-Mapper -lPods-Glitters -Xlinker -dependency_info -Xlinker /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters_dependency_info.dat -o /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Products/Debug-iphonesimulator/Glitters.app/Glitters
In the log I could see -Pods-Mapper is called for linking in line
-Xlinker -add_ast_path -Xlinker /Users/BharathMBA/Library/Developer/Xcode/DerivedData/Glitters-fakjqrbepxlfnzcvhrerurokbtzs/Build/Intermediates/Glitters.build/Debug-iphonesimulator/Glitters.build/Objects-normal/x86_64/Glitters.swiftmodule -mios-simulator-version-min=7.0 -lPods-Mapper -lPods-Glitters -Xlinker -dependency_info
I am not sure how to get rid of this issue.
Thanks
Go to the General tab of your target and scroll to section named Linked Frameworks and Libraries.
Here, you should see 2 references to your Pods' framework:
one with the name Pods_<previous-target-name>.framework
a second with the name Pods_<current-target-name>.framework
Delete the reference to pod Pods_<previous-target-name>.framework.
I had the same issue and found that some paths were not changed by xcode. I ended up doing the following:
Select your project file (top most entry in your xcode workspace)
Select the target you use to build your app
Switch to the build phases tab
Find the [CP] Embed Pods Frameworks and the [CP] Copy Pods Frameworks phase
Open them and you will see that they still have the old file path in there.
Change the file paths so they fit your new project name
However, this only gave me more errors. I selected the project itself this time and expanded the Configurations section. Here I saw that a lot of old references were used. Instead of manually changing them I decided that it was easier to deintegrate and install the pods again by using pod deintegrate and pod install which then solved the problem.
I guess the first steps are unnecessary when deintegrating but I think it's good to know that they exist.
I'm starting a new project that built fine after I added MagicalRecord via CocoaPods (my first experience with CocoaPods).
Right after constructing my data model, I received an error telling me I had not included an expected inverse relationship between two entities. I went into the data model and corrected this, and now I'm receiving this error upon rebuild:
Ld /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator/ProjectName.app/ProjectName normal x86_64
cd "/Users/myName/Desktop/Everything from DT 1:20:15/App projects/WMMG/ProjectName"
export IPHONEOS_DEPLOYMENT_TARGET=8.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 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator -F/Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator -filelist /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Objects-normal/x86_64/ProjectName.LinkFileList -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-MagicalRecord -framework CoreData -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=8.1 -lPods -Xlinker -dependency_info -Xlinker /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Intermediates/ProjectName.build/Debug-iphonesimulator/ProjectName.build/Objects-normal/x86_64/ProjectName_dependency_info.dat -o /Users/myName/Library/Developer/Xcode/DerivedData/ProjectName-ewvswzrvrwxktphioghlirgkuyju/Build/Products/Debug-iphonesimulator/ProjectName.app/ProjectName
ld: library not found for -lPods-MagicalRecord
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The error seems to point explicitly to a problem with the Linker and pods. The problem is that I have no experience debugging linker problems, and feel very out of my depth when the references I find to similar problems start talking about "dependencies" and such. It seems obvious that the MagicalRecord libraries aren't being found, but I don't know how the change I made might have caused the problem, and am even less sure how to correct it.
Can someone help, please?
That's very odd that Core Data would trigger this. To fix the link issue try typing pod install (cd to the folder containing your project workspace first).
guys, I really need someone's help. I am a newbie in iOS development, however everything went fine until I have accidentally deleted an entire Main.storyboard file instead of a single view. I have this file in my trash bin and I have tried to put it back but now the project is not compiling and throws this error instead:
Ld /Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Products/Debug-iphonesimulator/Test111.app/Test111 normal i386
cd /Users/Sergio/Projects/Test111
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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -L/Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Products/Debug-iphonesimulator -F/Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Products/Debug-iphonesimulator -filelist /Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Intermediates/Test111.build/Debug-iphonesimulator/Test111.build/Objects-normal/i386/Test111.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -framework CoreLocation -framework MapKit -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Intermediates/Test111.build/Debug-iphonesimulator/Test111.build/Objects-normal/i386/Test111_dependency_info.dat -o /Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Products/Debug-iphonesimulator/Test111.app/Test111
duplicate symbol _spacing in:
/Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Intermediates/Test111.build/Debug-iphonesimulator/Test111.build/Objects-normal/i386/ChatViewController.o
/Users/Sergio/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn/Build/Intermediates/Test111.build/Debug-iphonesimulator/Test111.build/Objects-normal/i386/AllMessagesViewController.o
ld: 1 duplicate symbol for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
What can I do to revert everything back?
Maybe you can try to delete the DerivedData folder related to your project.
Open your terminal, and type:
rm -Rf ~/Library/Developer/Xcode/DerivedData/Test111-gnlasierruehmngkenyhntisfyrn
After that, rebuild your project and try again.
Ok, I have figured this out on my own. There was some problem with two files - ChatViewController.m and AllMessagesViewController.m as you can see from the error log. Something has messed up there with the "spacing" variable when the storyboard file was deleted. So I have just deleted one of the conflicting files and rebuilt the project.
Learn to read logs.
I've been trying to get my app up and running. From what I could tell the app was missing Cocoapods as a dependency. So. I installed and added Cocoapods. But I'm still getting the same error for whatever reason. I'm an inexperienced developer trying to teach himself I must add.
Ld
/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella
normal i386
cd "/Users/bfarag/Desktop/The Nerdery/BRAVO.iOS.CodeChallenge"
export IPHONEOS_DEPLOYMENT_TARGET=7.0
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 i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
-L/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator
-F/Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator
-filelist /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Intermediates/Umbrella.build/Debug-iphonesimulator/Umbrella.build/Objects-normal/i386/Umbrella.LinkFileList
-Xlinker -objc_abi_version -Xlinker 2 -ObjC -lPods-Umbrella-AFNetworking -framework CoreGraphics -framework MobileCoreServices -framework Security -framework SystemConfiguration
-fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework Accelerate -framework UIKit -framework Foundation -framework CoreGraphics -lPods -lPods-Umbrella -Xlinker -dependency_info -Xlinker /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Intermediates/Umbrella.build/Debug-iphonesimulator/Umbrella.build/Objects-normal/i386/Umbrella_dependency_info.dat
-o /Users/bfarag/Library/Developer/Xcode/DerivedData/Umbrella-cspuzusfqmqgnwdqfhtiyivaqwke/Build/Products/Debug-iphonesimulator/Umbrella.app/Umbrella
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This error usually occurs either when you don't have the correct frameworks (might be missing one) or when you don't have the right thing in linker flags.
Go to the main page for the app (on the navigation thing on the left click on your apps name or the top section) -> Build Settings and under Linker Flags, make sure there is nothing in your Other Linker Flags. I had this same error when I had -ObjC in my other Linker Flags.
You might also want to try adding -lPods to your Other Linker Flags or adding the CoreGraphics framework if you don't already have it.
Good luck
Open workspace file, not project file. Cocoapods automatically creates a xcworkspace file on the same directory as xcproject file.
Xcode started displaying this message and I tried pretty much everything to solve it. What finally did the trick for me was deleting all content from ~/Library/Developer/Xcode/DerivedData/