How do I resolve the linker command error? - ios

I installed the Stripe pod into my project, and it was working, but now it decided to stop working. I keep getting this error. What does it mean, and how do I fix it?
Library not found for -IAFNetworking Linker
Linker command failed with exit code 1 (use -v to see invocation)

You must use the new <YourProject>.xcworkspace instead of <YourProject>.xcodeproj.
The xcworkspace contains your project and your pods.
You also can follow this steps:
Uninstall the App from Device or Simulator.
Make sure close all Xcode Projects. (.xcworkspace and .xcproject) (sometimes .xcproject still open)
Run pod install and pod update
Open the .xcworkspace
Clean and Build your Project
After that you should be able to run normally.

Related

Yet another Linker command failed with exit code 1

I built an app 2 months ago and now I want to work with it again. I opened up the project today and I am getting the error as follows:
Linker command failed with exit code 1
Why do I get this error?
build fail
pod folder
The linker error is because you can't find pods. Try the following:
Close Xcode
pod install
Open workspace
If that doesn't work:
Close Xcode
pod update
Open workspace
If that still doesn't work:
Close Xcode
Delete derived data
Delete Pods folder and Podfile.lock
pod update
Open workspace
If that STILL doesn't work... it could be your project's deployment target, make sure the targetted version is the same in both your project and the podfile.
As the picture say, can't find the pods. Just simply reinstall them with pod update. And ofcourse, don't forget to use .xworkspace files.

ionic3 - Apple Mach -O Linker (Id) Error?

This is the all error showing:
Apple Mach -O Linker (Id) Error?
"Linker command failed with exit code 1 (use -v to see invocation).
After I install OneSignal plugin in my ionic3 project, haven't setup all , When I tried to run my project in my device, this error coming out.
And when I open .xcworkspace file, two project showing to me. First one is my real project, last one is after I install OneSignal plugin and install sudo gem install cocoapods, pod repo update then showing
Just now I tried run ionic cordova run ios --device that can run in my device, but when I use xcode and hit play button which cannot run in my device and showing the error that my question title
Finally I found the way to solve this error!
Because I install pod for push notification fucntion, so try to use the .xcworkspace file to run the project after pod install instead of .xcodeproj file.
But I still don't know why .xcworkspace will showing this error when I install pod, if you know comment here please, thanks a lot!
1.Please install the pod file and always open with .xcworkspace.
2.Check if any files is deleted from the path (shown in red in workspace), please remove all red files.
3.Check whether files is set for the same target(if not please set all the files for the required targets).
4.Check the settings to add files.
Hope above points resolve your problem.

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

CocoaPods Google Analytics .xcworkspace and .xcodeproj files

I have an error in .xcodeproj:
ld: framework not found Pods (null): Linker command failed with exit
code 1 (use -v to see invocation)
I found the mistake the pod install folder was good, but I have to build the .xcworkspace, but I don't know why they're the error on .xcodeproj, and if it can be a problem on application deployment someone know why they're the error ? How to hide this error ?
Follow this steps:
Make sure close all Xcode Projects. (.xcworkspace and .xcproject) (sometimes .xcproject still open)
Run pod install and pod update
Open the ProjectName.xcworkspace
Clean and Build your Project
After that you should be able to run normally.
As cocoapods states when you setup cocoapods in your projects the first time, you need to use xcworkspace from now on. You can't work on xcodeproj directly. This is because it needs to have both Pods and your app project open at the same time.
Just close your xcodeproj and never open it again. Always open the xcworkspace and always work from there as long as you are using cocoapods in your project.

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