Xcode unable to archive react native project - ios

I am getting this error when I try to archive my React Native project.
I am able to run debug/release on iPhone and Simulator. react-native run works as well.
I have read through similar issues and tried:
Make sure I'm opening xcworkspace instead of xcodeproj.
Deleting Podfile.lock and running pod install and cleaning project.
Setting Build Active Architecture Only to Yes
Build output:
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/DoubleConversion'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/Folly'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/Google-Maps-iOS-Utils'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/React'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/glog'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/react-native-google-maps'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/react-native-maps'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/react-native-video'
ld: warning: directory not found for option '-L/Users/mans/Library/Developer/Xcode/DerivedData/teacher-gkqevnksdssljsbrniwvxaoxiwhi/Build/Intermediates.noindex/ArchiveIntermediates/teacher/BuildProductsPath/Release-iphoneos/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Did you try turning it off and on again? Try rebooting your Mac, often these problems go away.
Also try deleting the whole contents of DerivedData, in your case:
rm -rf /Users/mans/Library/Developer/Xcode/DerivedData/*
Does it work with some fresh project you get somewhere from GitHub?

Related

"warning: directory not found; error: library not found" using Xcode build

I'm trying to build an iOS app using Xcode. I'm new to XCode.
I had trouble building it for release purposes with this command : bundle exec fastlane beta that lead to an error :
❌ ld: library not found for -lDoubleConversion
I didn't know what to do so I started by trying to build my app with Xcode, and had this stack :
ld: warning: directory not found for option '-L/Users/myuser/Library/Developer/Xcode/DerivedData/mobile-eeuzlarvkxgtncfhtkicciemdrtq/Build/Products/Debug-iphonesimulator/DoubleConversion'
ld: warning: directory not found for option '-L/Users/myuser/Library/Developer/Xcode/DerivedData/mobile-eeuzlarvkxgtncfhtkicciemdrtq/Build/Products/Debug-iphonesimulator/react-native-cameraroll'
ld: warning: directory not found for option '-L/Users/myuser/Library/Developer/Xcode/DerivedData/mobile-eeuzlarvkxgtncfhtkicciemdrtq/Build/Products/Debug-iphonesimulator/react-native-image-picker'
ld: warning: directory not found for option '-L/Users/myuser/Library/Developer/Xcode/DerivedData/mobile-eeuzlarvkxgtncfhtkicciemdrtq/Build/Products/Debug-iphonesimulator/react-native-safe-area-context'
ld: warning: directory not found for option '-L/Users/myuser/Library/Developer/Xcode/DerivedData/mobile-eeuzlarvkxgtncfhtkicciemdrtq/Build/Products/Debug-iphonesimulator/react-native-webview'
ld: warning: directory not found for option '-L/Users/myuser/Library/Developer/Xcode/DerivedData/mobile-eeuzlarvkxgtncfhtkicciemdrtq/Build/Products/Debug-iphonesimulator/rn-fetch-blob'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)
From what I already read, I should add these libraries to the Search Paths > Library Search Paths in XCode but these libraries already are set in this configuration. ( screenshot below )
And the "PODS_CONFIGURATION_BUILD" is set as below :
I tried removing those paths and launch the build again, but the project couldn't build. So I reverted the changes.
I'm not sure about what I need to do as I'm new to XCode and this is an existing project.

React Native can not build and run by Xcode10

New react native project can react-native run-ios to run on device but can not run by xcode 10.
It gets the error when I build the project.
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/DoubleConversion'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/Folly'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-Core'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-DevSupport'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTActionSheet'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTAnimation'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTBlob'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTImage'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTLinking'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTNetwork'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTSettings'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTText'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTVibration'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-RCTWebSocket'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-cxxreact'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-fishhook'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-jsi'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-jsiexecutor'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/React-jsinspector'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/glog'
ld: warning: directory not found for option '-L/Users/viatick/Library/Developer/Xcode/DerivedData/BMSHelper-ehajbfildwyjzqgtszurmsvheorm/Build/Products/Debug-iphoneos/yoga'
ld: library not found for -lDoubleConversion
I need to add some native modules in ios but now I get the problem with building the project in xcode10.
As I know, the ios project uses cocoapods then I try deleting the podfile.lock and run pod install again but it did not work.
I also tried delete node_modules folder and run yarn install again but still get problem.
I expect to build it and can run from xcode. Now it only can run by command react-native run-ios
Make sure you have opened "projName.workspace" ,then select your project goto "General" tab -> "prjtNameTests" then select host application "yourproject"

Xcode returns linker error "library not found for -lFirebaseAuth"

I wanted to test firebase initial app on Unity. I made a build from Unity in macOS and in Xcode project folder, I have runned the pod command successfully.
pod install
After this I opened Xcode project and I clicked to build button. Before this, I was getting framework not found error. I fixed it and now I am getting
ld: warning: directory not found for option '-L/Users/ali/Library/Developer/Xcode/DerivedData/Unity-iPhone-giljorflztrrychfchrkhcfbqtbh/Build/Products/ReleaseForRunning-iphoneos/FirebaseAuth'
ld: warning: directory not found for option '-L/Users/ali/Library/Developer/Xcode/DerivedData/Unity-iPhone-giljorflztrrychfchrkhcfbqtbh/Build/Products/ReleaseForRunning-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-L/Users/aliavci/Library/Developer/Xcode/DerivedData/Unity-iPhone-giljorflztrrychfchrkhcfbqtbh/Build/Products/ReleaseForRunning-iphoneos/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/ali/Library/Developer/Xcode/DerivedData/Unity-iPhone-giljorflztrrychfchrkhcfbqtbh/Build/Products/ReleaseForRunning-iphoneos/GoogleToolboxForMac'
ld: warning: directory not found for option '-L/Users/ali/Library/Developer/Xcode/DerivedData/Unity-iPhone-giljorflztrrychfchrkhcfbqtbh/Build/Products/ReleaseForRunning-iphoneos/nanopb'
ld: library not found for -lFirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I have already added library pathes to library search path. I added some screenshots as attachments.
I solved the error by opening ".xcworkspace" file, instead of ".xcodeproj" file.

XCode Not build my project

I'am using React-Native and react-native-maps but if i want to build it will build failed. Errors is "Apple Mach-O Linker Error Group"
Error:
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/DoubleConversion'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/Folly'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/Google-Maps-iOS-Utils'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/React'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/glog'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/react-native-google-maps'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/react-native-maps'
ld: warning: directory not found for option '-L/Users/mrkacan/Library/Developer/Xcode/DerivedData/tracis-hckbanztjtfhnresvxragwaciwlc/Build/Products/Release-iphonesimulator/yoga'
ld: library not found for -lDoubleConversion
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Edit:
set Build Active architecture Only to Yes
and add Google maps library its worked!
Please close the xcode project, and open the .xcworkspace file (with white XCode icon) and build your project, as it is required by any project that use Pods.

linker command failed with exit code 1

I am getting some errors and warnings when I build my IOS project
ld: warning: directory not found for option '-L/Users/parikshitpatel/Documents/IphoneDevelopment/FH/funkiorangemobile_iphonehealthadviceapp/Social'
ld: warning: directory not found for option '-LMedia/Twitter/Twitter'
ld: warning: directory not found for option '-LLibrary/Libraries'
ld: warning: directory not found for option '-L/Users/parikshitpatel/Documents/IphoneDevelopment/FH/funkiorangemobile_iphonehealthadviceapp0/Social'
ld: warning: directory not found for option '-L&'
ld: warning: directory not found for option '-LHeaders'
ld: warning: directory not found for option '-LMedia/Twitter'
ld: library not found for -lOAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am not getting how to fix this error can some one help?
It looks like your Library path is incorrect.
Try to go to: Targets - Build Phases - Link Binary with Libraries
and add your Twitter Library/Framework
In your Folder path there are blank spaces between them. for example:
/Users/parikshitpatel/Documents/IphoneDevelopment/FH/funkiorangemobile_iphonehealthadviceapp/Social Media
In your Library dependencies write Social\ Media instead.
Do the same for other library.
For me I was opening the .xcodeproj Xcode project instead of the .xcworkspace workspace. I'm pretty new to iOS development, but this feels similar to opening the wrong gradle file in Android Studio

Resources