Cocoapods : ld: library not found for -lBolts - ios

I am using cocoapods in one of my projects and after I cleaned the derived data for my project I have started seeing this error
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/Bolts'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/DownPicker'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/MBProgressHUD'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/Parse'
ld: warning: directory not found for option '-L/Users/vishal/Library/Developer/Xcode/DerivedData/SensorLab-ctzyiyrpdclyjybpujriezgkckkn/Build/Products/Debug-iphoneos/SCLAlertView-Objective-C'
ld: library not found for -lBolts
clang: error: linker command failed with exit code 1 (use -v to see invocation)
When I open up the Debug-iphoneos from Window > Projects I do not see any folders in there now. Since this problem started cropping up after cleaning derived data I do not really know what did I do which stopped generating those folders.
This is how it looks :
This is kind of how it should look, I imagine (From a different project)
I have tried what was suggested here
Cocoapods ld: library not found for -lPods-Projectname
Cocoapods ld: library not found for -lPods-ObjectiveSugar
And a couple more things which I have tried but to no avail, I have faced my fair share of cocoapod niggles. This seems beyond me.
EDIT: I have been doing some more tests with this, I realized that my pods are not even building ! When I clear derived data for any other project, it goes ahead and builds the Pods next time I try to build the project, but not in this project. What setting can wrong ?
This is how the project looks right now :
Any help will be appreciated.

Clean up cocoa pods and install them again.
You can also use tool - https://github.com/CocoaPods/cocoapods-deintegrate

Somehow the option of Find Implicit Dependencies got turned off in the build scheme. SMH.
Hope this can help someone in the future.

Related

React Native and RNFirebase iOS Release Builds Failing

I'm using Firebase via RNFirebase in React Native. I've gone through the steps here: https://rnfirebase.io/docs/v5.x.x/installation/ios.
Debug builds in the Simulator and to my device work just fine, but when I attempt to archive a Release build it fails with this error.
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseAuth'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/FirebaseCore'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GTMSessionFetcher'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/GoogleUtilities'
ld: warning: directory not found for option '-L/Users/rob5408/Library/Developer/Xcode/DerivedData/myApp-fggubxxejruuksefqfhjorhysodz/Build/Intermediates.noindex/ArchiveIntermediates/myApp/BuildProductsPath/Release-iphoneos/nanopb'
ld: library not found for -lFirebaseAuth
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Also in the build logs I can see that the Debug config builds those targets, but they are not in the output for Release config builds. I get the feeling it has to do with building for all architectures, but don't know how where to start solving that. I just feel like I am poking around without a real strategy to solve it. Any ideas?
Some things I have tried...
Using the Legacy Build System
Removing node_modules and rerunning npm install
Removing / adding the related pods
Deintegerating and readding Cocoapods
Clearing DerivedData
Restarting my computer
I've seen this happen when switching use_frameworks! off and on.
The solution was deleting FirebaseAuth and other libraries from the Build Setting - Other Linker Flags(OTHER_LDFLAGS)
I got help from this PR: https://github.com/invertase/react-native-firebase-starter/pull/61
It was a combo of dropping down to the Legacy Build System in Xcode 10 and upgrading React Native to 0.57.2.

directory not found for option '-F/Applications/Xcode.app/../Developer/Library/Frameworks' ld: file not found:

I'm not sure why but all the sudden my project fails to build and shows:
ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.2.sdk/Developer/Library/Frameworks'
ld: file not found: /Users/../Library/Developer/Xcode/DerivedData/inline-ios-axberuiwgueuitfzxttaoekgigob/Build/Products/Debug-iphonesimulator/myapp-ios.app/my-app
clang: error: linker command failed with exit code 1 (use -v to see invocation)
how can I investigate this?
I recently deleted a file from the tests folder
and the bundle id was changed a day ago
Update
I saw an answer in another thread in SO, saying to delete anything under framework search path.
but mine was empty already
Make sure to check all of your targets. My main app target had the Framework Search Path already empty and still had this issue as well.
I found a Github issue for a project having this issue and they solved it by removing a test (or test file maybe). I checked my test target and found that it did have the {SDK-ROOT} path in there still. I deleted it, and the warning went away.

Library not fount -lPods

I got follwing errro in my application.
ld: warning: directory not found for option '-L/Users/idev/Desktop/Swami/Project/Sources/Xcode/chronicle/chronicle/Vendor/openssl-1.0.1e/lib'
ld: library not found for -lPods
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please help me...
You need to open ".xcworkspace" instead of ".xcodeproj". the .xcworkspace is generated when you install pod on the project.
Xcode is not able to find the library, and hence the library error. Click on the project target, go to build settings, under search paths -> frameworks search paths, delete paths. You may have moved your desktop folder along with the library.
It seems project has been using http://cocoapods.org/. and that files are missing from your project.
You cant just download it from git. You need to install it from cocoapods.
you may follow Introduction to http://www.raywenderlich.com/64546/introduction-to-cocoapods-2 Tutorial

duplicate symbol of _main in Tesseract libtesseract_all.a(svpaint.o)

I've clone the project of "iPhone-OCR-Tesseract-and-OpenCV" from Github, installed its pod, compiled files and it works great.
However, I try to merge the pod file with my existing one and compile it, I have an issue that shows
duplicate symbol _main in:
/Users/ivanlin/Library/Developer/Xcode/DerivedData/MailTracker-duddjrlaosmnafgcbrqibnzstqws/Build/Intermediates/MailTracker.build/Debug-iphoneos/MailTracker.build/Objects-normal/armv7/main.o
/Users/ivanlin/Documents/Projects/MailTracker/Pods/Tesseract/lib/libtesseract_all.a(svpaint.o) ld: 1 duplicate symbol for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see invocation)
It seems that there is another main function in the Tesseract library.
I am wondering why this issue does not show up in the original project.
I try to compare possible compile and link options between the original project and mine and there is no clue.
If anyone have experience to address this issue, please help a bit. I will very appreciate.
Many thanks.
To answer my own question.
I've found the root cause and it is not relevant to re-including a main file.
After comparing "iPhone-OCR-Tesseract-and-OpenCV" and my own project, I found that my project has an additional linker option which is "load_all".
After removing out this "load_all" option, the issue is gone.
I am not sure why it cases the issue, but it is a solution in my case.

Moved Xcode project has missing files from other libraries

I moved the folder of a project in Xcode to another computer, and I"m having some issues. I'm using NMSSH framework, and the libz.dylib file is missing from the project, and I'm unable to locate it, since the Inspector button for it is grayed out. The file is not on my system either. Shouldn't it have been inside my project folder?
Also, I'm using MBProgressHUD, and I'm using it by dragging its Xcode project in, and setting the appropriate links. One of the libraries libMBProgressHUD.a is missing, and I can't locate that either.
Everything was working fine on my other computer, so I'm guessing there's a problem with search paths, etc? Any help would be much appreciated. The errors are as follows:
ld: warning: directory not found for option '-F/Users/ramesh/Documents/CodeDump_Temp/iOS/RasbPiController/../../.Trash'
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NMSSHSession", referenced from:
objc-class-ref in UserPi.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
you can download the missing file from the link below
https://www.dropbox.com/s/au2irnctslcpjih/libz.dylib
and paste it in your iOS Simulator folder. I hope it will work .

Resources