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.
Related
I am trying to run an ionic app on xcode. But xcode throws an apple match-o linker error. I get this error, when I get this after I have runned the following command:
cordova plugin add phonegap-plugin-push --variable SENDER_ID=5****** --save
I need this plugin, for push notifications. After a research on google, I founded that I need to have Cocoapods installed in the projects. But after installing Cocoapods & pod install. I get the following error, when I start the "project.xcworkspace".
diff: /Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I tried to rebuild/clean project or install pod again. But it did not fixed for me.
Can someone help me?
EDIT -> new Error
Apple Mach-O Linker (ld) Error Group
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I am getting this error, when i have fixed the error with pods.
If you are setting up environment setup in your project, you have to choose corresponding pods target in configuration.
Update your CocoaPods installation first ("sudo gem install cocoapods")
then remove everything related to POD from project directory except .podfile.
Run "pod install" on terminal and open your project using workspace file.
1- Remove PODS folder from project folder and then perform pod install and open project using .xcworkspace file.
If above one don't work, go to Xcode Build phase and check for path in scripts added by PODS(usually with pods word in there title), sometimes for hybrid project the path was not correct for podfile.lock and manifest.lock file lookup in the script.
Easiest Solution which worked for me:
Open terminal inside your project directory
Change directory to 'ios' (cd ios)
Type 'pod install' and wait for dependencies getting downloaded and installed
I hope this will help someone out!
In my case, I updated cocoapods and the problem was solved.
gem install cocoapods --user-install
My case, Please:
Xcode → File → Workspace Settings.
Make sure in tag: Build System → New Build System.
Please copy your Podfile.
Delete Podfile, Podfile.lock, Pods Folder in your root app folder, like this.
Next Step, Open <YourProject>.xcodeproj. You should use Terminal by:
open <YourProject>.xcodeproj. (Remember not .xcworkspace)
In Pods tag, delete these files, like this:
<Pods-YOURPROJECT>.debug.xcconfig
<Pods-YOURPROJECT>.release.xcconfig
Pod init and Pod install your Project again.
Open <YOUR PROJECT>.xcworkspace, with Terminal: open YOURPROJECT.xcodeproj
CMD+SHIFT+K to clean build.
CMD+B to build again.
Enjoy
Last year I had used the similar plugin, when I was working on an App Update, I came to know that this plugin got deprecated. Not sure about the above one.
So I've working using FCM. I had the similar problem while working with FCM. After having spent nearly a day on researching on this I've found a cordova plugin which takes care of pods in cordova.
Plugin name:
cordova plugin add cordova-plugin-cocoapod-support --save
Please Note: After installing this plugin, there's no need of podinit, or opening the pod and installing it. This plugin will take care of it. It will create a AppDelegate inside the plugin folder where it will handle everything - you can retrieve Push Token as well in DEV mode if you wish.
After I installed this plugin and build iOS, there were no issues.
** Note **
Please ensure while working with FCM, no other google plugins are installed, they'll conflict. Earlier I had GoogleAnalytics plugin, as it's now covers within FCM - you can remove Old GoogleAnalytics plugin in order to work with FCM without issues.
For my Cordova project doing pod init in the ios folder fixed the issue.
From your Cordova project root directory you would:
cd /platforms/ios
pod init
cd ../../
cordova build ios
i am getting following issue While running an application.but i am stuck at this issue
error: unable to read module map contents from 'Target Support Files/AFNetworking/AFNetworking.modulemap': Error Domain=NSCocoaErrorDomain Code=260 "The file “AFNetworking.modulemap” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Volumes/DATA/Working Projects/demo New/BackUp/21-3/demo/V1/Pods/Target Support Files/AFNetworking/AFNetworking.modulemap, NSUnderlyingError=0x7fae56f2e1c0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}
Please check Screenshot
issue image
can you please help me to figure out this issue?
Xcode might be using another projects project path, even though your project is a new project. Closing Xcode and deleting the xcode preferences from ~/Library/Preferences/ might fix the issue.
Check whether it is related to Pod files, if so try installing using pod install cmd via terminal.
AFNetworking is related to PodFiles, just comment out your pod files and then run pod install in your terminal (it will remove the respective files). Now remove the comment in your pod file and run pod install again.
Sometimes this issue comes when you left library installation using cocoa pod without completion.
Hitting command pod install worked for me.
For me this issue was raised, when a developer changed the upper and lower case writing of a Pod.
However, this solved the issue for me:
rm Podfile.lock
pod deintegrate
pod install
Cleaning up preferences, project and rebuild should do the job.
close Xcode
cd ~/Library/Preferences/
ls -l | grep -i xcode | xargs rm
open Xcode
shift + cmd + K
cmd + B
I came with this issue when deleted a pod file. After that I install the pod again.
But encountered the same issue.
Then I followed the following step which worked for me.
Deleted the derived data
Clean and build the project
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.
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.
How to solve this issue. I have downloaded the iOS project from the Git repo and when I try to build, it gives an error:
Check dependencies
The file “Pods.xcconfig” couldn’t be opened because there is no such file. (/Users/YoGesh/Desktop/Xy-3/Pods/Pods.xcconfig)
PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/YoGesh/Library/Developer/Xcode/DerivedData/Xy-bmwkojrwthnvzdfxthnxeqgesekm/Build/Intermediates/Xy.build/Debug-iphonesimulator/Xy.build/Script-C0451AB63D7F4B73830000BA.sh
cd /Users/YoGesh/Desktop/Xy-3
/bin/sh -c /Users/YoGesh/Library/Developer/Xcode/DerivedData/Xy-bmwkojrwthnvzdfxthnxeqgesekm/Build/Intermediates/Xy.build/Debug-iphonesimulator/Xy.build/Script-C0451AB63D7F4B73830000BA.sh
diff: /../Podfile.lock: No such file or directory
diff: /Manifest.lock: No such file or directory
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I found a good hint inside the issues of CocoaPods on GitHub, try this:
Close your project (better close Xcode completely)
Open the Terminal inside your project and execute pod install
Open your project again. If there are still errors clean your project ( Shift + cmd + K ), after this the errors should be gone.
Restarting Xcode helped me. Pod update and install didn't help.
Go to your project directory from the terminal
run "pod update"
Hey i had this same problem, I was getting the following error when running pod update however i didn’t realise the update wasn’t working.
$ pod update
Analyzing dependencies
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/pathname.rb:422:in `open': No such file or directory
It was because I forgot to run "pod setup" after installing cocoapods.
I ran pod setup from the terminal, followed it up with pod update (or pod install) and everything went to plan.
Closing Xcode, pod update and pod install didn't help me.
I just ran the install cocoapods command again:
sudo gem install cocoapods
If you see error:
You don't have write permissions for the /usr/bin directory
Use next command:
sudo gem install cocoapods -n /usr/local/bin
You may be using the Xcode default project file. After installing the framework through pod, you must use the generated xcworkspace in the project folder.
Example : SampleProject.xcworkspace.
For those who want to solve this issue and tried to remove the cocoa pods from the project:
1. Open the project, on the left side there must be a folder named Pods
2. Delete the folder and the problem will be solved
!!! Do not do this if you need cocoa pods
I've experience a similar situation, for me, it's an error stop all the pods to be updated when I ran pod update.
Try to resolve the error and run pod update again, clean your project then try to build again.
I Tried pod update command in terminal for the project, it did not fix the issue.
then I Tried pod install command for the same project, it installed all the pod dependencies and the project got indexed and all those type of issues got fixed.