cocoapods: library not found for - ios

ld: library not found for -l<libname>
clang: error: linker command failed with exit code 1 (use -v to see invocation
I have got a such problem.
I've created a project in one Mac. But when I move project to another computer and try to add a new library from cocoapod the linker cannot find a new library.
I've tried a lot of features:
recreated via pod init.
pod update
cleared cache
rm -rf "${HOME}/Library/Caches/CocoaPods"
rm -rf "`pwd`/Pods/"
pod update
Even reinstalled cocoapods.
removed old workspace file.
etc.
But none of them helped me. Please, help me find the solution.

A few hours later I found that I have to use $(inherit) flag for 'Library Search Path' . I do not know why it worked in the first computer without with flag.

Related

clang: error: linker command failed with exit code 1 (use -v to see invocation) while Achieving?

I know many developers asked the same question but no solution worked for me.
I am trying to Archive my project but I am getting error:
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is my Screenshots :-
.
I tried :
clean and build.
Enable bit code.
Remove 'Derived Data'.
Is there anything that I have to add?
I have had the same problem. It was because of GoogleMaps pod.
Remove any Google pods from pod file
call pod install
Return back Google pods into pod file
call pod install again
I have faced same issue, today I tried this and resolved me issue. I am using XCode ver 8.3.2.
command+option+shift+K -> Clean
Try, Might help you.
You can also try this
First close the XCode, Run the commands in terminal. then restart the XCode.
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData
rm -rf ~/Library/Caches/com.apple.dt.Xcode
I didn't know but I changed one small thing "Enable Bitcode" in Build Settings and its working fine.
Thanks to all for sharing your knowledge.

How to solve this error ”_OBJC_CLASS_$_MBProgressHUD", referenced from:?

I have an existing project with different project name & workspace name. There is no podfile in the application folder. It has Pods folder with Pods.xcodeproj file. All other files are missing. But we can open and run the project using workspace file. Third party libraries are added manually. I have installed pod and created workspace with same name. I can open and run the application.
I have removed MBProgressHUD library and installed it using Cocoapods. After that I can’t run the application and got the following error message.
"_OBJC_CLASS_$_MBProgressHUD", referenced from: objc-class-ref in
BlackboardGroupController.o objc-class-ref in MenuController.o ld:
symbol(s) not found for architecture x86_64 clang: error: linker
command failed with exit code 1 (use -v to see invocation)
Remove all CocoaPods and Integrate again. Please do the following steps to remove Cocoapods.
1.Delete the standalone files (Podfile Podfile.lock and your Pods directory)
2.Delete the generated xcworkspace
3.Open your xcodeproj file, delete the references to Pods.xcconfig and libPods.a (in the Frameworks group)
4.Under your Build Phases delete the Copy Pods Resources, Embed Pods Frameworks and Check Pods Manifest.lock phases.
5.This may seem obvious but you'll need to integrate the 3rd party
libraries some other way or remove references to them from your code.
pod deintegrate and pod clean are two designated commands to remove CocoaPod from your project/repo.
Here is the complete set of commands:
$ sudo gem install cocoapods-deintegrate cocoapods-clean
$ pod deintegrate
$ pod clean
$ rm Podfile
Clear DerivedData :
rm -rf ~/Library/Developer/Xcode/DerivedData
Close Xcode and install cocoapods again

trying to updates the pod files getting the error in the terminal

[!] The target `project name` is declared twice.
when i m trying to update the pod files in the terminal,i am getting the error in the above..kindly help..
i have tried to uninstall and reinstalling the pod files but still giving the same error.kindly give a step by step process as i am new in this concepts.
how can i update my pod files . there is another error that is shown in the app when i run the app.
ld: library not found for -lPods-aditestdemo
clang: error: linker command failed with exit code 1 (use -v to see invocation)
for this i am updating the pod files kindly help me out. what i can do to rum my app.
this is because when you hit update command from terminal, this updates your existing pod file . There is
To remove bug just do :-
(1).delete podfile, podfile.lock, Pods, and your .xcworkspace.
(2).and reinit pod file and install it your project path.
Refer the link this will clear your doubt:-
https://guides.cocoapods.org/using/pod-install-vs-update.html

How to remove all references to a library?

I have a pretty classical error during my project building:
ld: library not found for -lAppLovinSdk
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Originally I got the library from Cocoapods pod, but then I started having a lot of errors and decided to remove the pod from the Podfile and executed pod update
My Podfile looks like this:
I've tried to clean project, reinstall the Podfile, deleting Pods folder and Podfile.lock file, "Build Active Architecture Only" is set to "No", but I still have the error. I assume I still have some references to libraries from the deleted Pod. What is the way to get rid of them?
UPDATE: Here is a full error message:
Ok, so I figured out the problem:
I had to go to Target -> Build Settings -> Linking -> Other Linking Flags and there I had to remove all deleted libraries references, manually. And then it worked!

library not found for -lPods from GitHub project

I am getting the following error when trying to build a project I found on GitHub.
ld: library not found for -lPod
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I've heard of some people saying to use the workspace file instead of the workspace file but there is no project file.
Here is the project
My app can run on simulator but can't run on device.
I fixed this by these steps.
The Pods Xcode project now sets the ONLY_ACTIVE_ARCH build setting to YES in the Debug configuration. You will have to set the same on your project/target, otherwise the build will fail.
Ensure your project/target has an ARCHS value set, otherwise the build will fail.
When building a iOS project from the command-line, with the xcodebuild tool that comes with Xcode 4, you’ll need to completely disable this setting by appending to your build command: ONLY_ACTIVE_ARCH=NO.
http://guides.cocoapods.org/using/troubleshooting.html
All my pods project have debug build only active architecture to YES(from pod install), but my project set to NO. So, I change it to YES, then it's work.
This project uses Cocoapods to manage its third party dependencies. Whilst the developer has committed the Pods/ directory, it's probably best to install the Pods yourself:
Install Cocoapods if you don't already have it: sudo gem install cocoapods
cd into the top level project directory, and install the required Pods for this project: pod install
Open the TestOCR.xcworkspace that will be created.
Build and run.
I got it working, all I had to do was simply drag the Pods.xcodeproj into the TestOCR.xcodeproj thanks for the help.
I have encountered this issue couple of times and the common fix is to simply build the Pods target.
The project seems to have bad CocoaPods configuration (or not at all). There is no workspace and no Podfile (which is even worse, because if there's a Podfile you can install CocoaPods by your own and update pods).
You can look into Pods directory and try to create Podfile from scratch (depending on found libraries) and the install CocoaPods. This should work.

Resources