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.
The Problem
I recently started working on a project.
Which Uses Cocoa Pods as the dependency manager.
It also uses Crashlytics for crash reporting.
Image Magick for Icon generation and Synx for reorganizing the project folder.
I was given Git access.
So I cloned the repo.
did a pod install
and compiled the code but it started giving me following error.
Project target is iOS 7.
Cocoa Pods Version is 0.36.4 also tried Latest 0.38.2
It is an iphone only app.
What I have done So far trying to solve this issue
So I sat down with the Original developer who was very helpful and had a working copy of the code on his machine. As it was a code handover so he was helping me setting it up on my machine.
We have tried all the usual suspects.
Clean and Build
Clean Quit Xcode Reopen and build
Quit xcode delete the Pods Directory and do a pod install
pod setup
pod update
Checked PODS_ROOT paths for different build configurations with working copy on another machine where it compiles correctly
My pods were latest so I uninstalled cocoapods using sudo gem uninstall cocoapods and installed the version the original developer had sudo gem install cocoapods -v 0.36.4
Matching Xcode versions xcode 6.4
Checking Configurations under Info in Project
Another pull from Github at a different location and doing all above steps.
Clear Xcode derived data folder.
So basically we checked all this retried all the above steps many times and also verified project settings build phases etc.
code is running fine on his machine.
Some weird behaviour i noticed was that one time instead of above mentioned error in picture it gave the famouse xyz.h file not found error for one of the libraries in Pods. But doing a pod install reverted back to original error.
Any ideas?
I remember this one.. I think it is due to cocopods changed the directory of there "copy pods resources" shell script from one version to the other. Look under your targets build phases and check for a "run script" entry i think. Look at the path and then check in finder to see where the shell script is really located.
Not really certain of the details... it might have been one of the other cocopods enters in the build phase section. Look around there, I do remember it was pretty easy to spot when you know where to look.
Should probably be the "Check Pods Manifest.lock" section under Build Phases.
Make sure you are opening workspace project(.xcworkspace) instead of XCode Project..
Else
Remove podfile.lock
Remove Pods Folder
Remove .xcworkspace
Remove manifest.lock (if exists)
Go to path of pod file and Run pod install
Then it will generate .xcworkspace.
Now onwards you need to use workspace instead of xcodeproj
Hope it helps you..!
I have got the following errors after trying multiple answers from the google.
PhaseScriptExecution Check\ Pods\ Manifest.lock /Users/apple/Library/Developer/Xcode/DerivedData/Build/Intermediates/FoodSpot.build/Debug-
iphonesimulator/FoodSpotTests.build/Script-36819C3C1B6A30F50091382D.sh
cd "/Users/apple/Downloads/FoodSpot 2"
/bin/sh -c /Users/apple/Library/Developer/Xcode/DerivedData/Build/Intermediates/FoodSpot.build/Debug-iphonesimulator/FoodSpotTests.build/Script-36819C3C1B6A30F50091382D.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 have updated and installed many times, but they are of no use.
For me, the reason was missign User-Defined variables in the Build Settings!
Looking into the issue, the Build Phases tries to diff 2 files.
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
Just because of missing PODS_PODFILE_DIR_PATH and PODS_ROOT variables, assumes them as "" so ${PODS_PODFILE_DIR_PATH}/Podfile.lock points to /Podfile.lock and same for the other one.
So it fails in
diff /Podfile.lock and /Manifest.lock
I fixed this by adding 2 User-Defined settings to the Build Settings
PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
After hours of searching this is the only solution that worked for me
For me, it works after the following:
pod deintegrate --verbose
pod install --verbose
Run 'pod install' or update your CocoaPods installation.
You have answer in the error itself !
The error message states that you should update your CocoaPods installation.
You could remove libPods in frameworks and libraries and update Cocoapods using pod install.
Also:
clean and build the project
SO references :
CocoaPods Errors on Project Build
Error:"The sandbox is not in sync with the Podfile.lock..." after installing RestKit with cocoapods
I had been searching for hours and I found solutions as follow:
In my case, method 3 works.
Method 1:
choose the target > go to Build Phrases > click Link Binary With Libraries > remove all libPods.a files
open Terminal > direct to your project > run:
pod install
clean and build project
ref.1
Method 2:
open Terminal > direct to your project > run:
pod deintegrate --verbose
pod install --verbose
ref.2
Method 3:
choose the target > go to Build Settings > click "+" sign
add 2 User-Defined Settings: [to the left = to the right]
PODS_ROOT = ${SRCROOT}/Pods
and
PODS_PODFILE_DIR_PATH = ${SRCROOT}/
ref.3
Just go to Build phases and click on [CP]check Pods Manifest.lock.
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
Both PODS_PODFILE_DIR_PATH and POD_ROOT should define in user-Defined in build settings.
POD_ROOT should have correct path to Manifext.lock file and
POD_PODFILE_DIR_PATH should have correct path for Podfile.lock
So Add below in build settings.
PODS_ROOT ---- ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH ---- ${SRCROOT}
The problem is Podfile.lock and Manifest.lock cannot be found by the Check Pods Manifest.lock Script in your targets build phase.
This is usually caused by PODS_PODFILE_DIR_PATH and PODS_ROOT variables not being defined.
Go to build settings tab to define them.
You will need to look for Podfile.lock and Manifest.lock in your project and get the the full paths of their directories. The directory paths will be the values you use for PODS_PODFILE_DIR_PATH and PODS_ROOT.
Deleting the derived data did the trick for me . I deleted by going into the finder itself.
Make changes in the podfile as given below:
Older pod file
target :TargetName, :exclusive => true do
Changed pod file
target 'TargetName' do
I'm pretty sure that you have opened your Projects' workspace which you try to install new Pods. So try out the following (for me this worked):
Clean the project
Close the project
Run pod install
Open the project and try re-building it once more
Problem might have been resolved.
Edit
It turned out my issue was due to a new line at the end of the Manifest.lock that was not present in the PodFile.lock file. Running a diff on the two files highlighted the issue.
Adding a new line to the end of the PodFile.lock file solved it.
Original Answer
None of the answers have worked for me so I have just checked the "For install builds only" under "[CP] Check Pods Manifest. lock" which is found in the build phases tab.
I believe this setting means it will only run that check when archiving, allowing me to continue developing as I don't need to archive the app on my machine.
Use with caution though as it may not be the best solution for everyone.
This happens if cocoa pods don't install or uninstall properly
If you want to install cocoa pods run
pod install
if you you want to uninstall cocoa pods then run command
pod deintegrate
I had the same issue. Turned out the cocoapods version on Manifest.lock was higher than what I had on my mac. I had to do a 'sudo gem install cocoapods', to get the version of the cocoapods upto what was specified on the Manifest.lock file. This fixed the issue and I had no errors on building the project.
Im facing the same issue now and fixed using this command after navigating to project location in terminal.
pod install --repo-update
I fixed this by adding 2 User-Defined settings to the Build Settings
PODS_ROOT = ${SRCROOT}/Pods
PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
In my case, I got same error after integrating my other targets. To solve problem I needed to add both targets in Podfile:
abstract_target 'myApp' do
use_frameworks!
pod 'Alamofire', '~> 3.0'
pod 'SwiftyJSON'
target 'myAppOtherTarget'
end
Make sure you add a "pod install" command line build step, before the Xcode Project build step.
The error is coming from the build phase run script in your Xcode project's target, which is unable to find Podfile.lock. This file is generated by CocoaPods, which must be installed in a build step in your TeamCity project.
My build steps look like:
Command line: bundle install --path .bundle (installs cocoapods local to the project using Gemfile).
Command line: bundle exec pod install --verbose (uses Podfile)
Command line: carthage update --platform iOS (uses Cartfile)
Xcode Project
Command line to build an archive
Command line to upload a build
Hope this helps.
In my case, the errors were occurring on a _Tests target. I didn't need the _Tests target, and so I deleted it. This resolved the error.
If you happen to move your Podfile like i did and face this issue, the solution discussed below may help -
Delete all of the following - Pods folder, xcworkspace
file, podlock file (skip the ones that are not available for subfolders)
delete all steps that has [cp] in it from the build phase tab
repeat step 1 & 2 for all the sub projects that you have in your workspace
open workspace, go into each project and delete framework for pods, and delete the pods folder from each project
close workspace
run pod install
you should now be able to open, build and run the project
I just fixed it by updating the Cocoapod, cause before the error there was log where the warning shows we need to upgrade our cocoapods as the pod files are not supported by the current cocoapod version, So clean the project , upgrade cocoapod then install pod.
1. Clean project
2. sudo gem install cocoapods/gem install cocoapods
3. pod install (optional if your project still shows error)
Note: I found this error for my flutter application in iOS platform
I think you are trying to use your old project pod folder in your current project, you have to copy Manifest.lock file of your current project and replace that file in your old project's pod folder which you added. Manifest.lock file location YourProject->Pods->Manifest.lock
Hope This was helpful. worked for me!
Please check Top Sites - Sandbox Sync iOS for more explanation. I fixed the issue by changing file paths from
diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
to
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
in Xocde -> "Open Your Project" -> "Select Your Project" -> "Select Your Target" -> Build Phases -> Check Pods Manifest.lock
If not, try changing paths as mentioned above, along with Legacy Build System. To change build system Xcode -> File -> Workspace Settings -> Build System -> Legacy Build System
I hate to say this, but I just removed the pods/ or didn't include them in the project and it built. I don't know if this will have a long-term effect on the project though.
This is presently my .sh build script for ionic5 for ios. It will probably change in the future.
# BUILDING FOR IOS
##################################
#
# MAKE SURE YOU UNPLUG ALL DEVICES!!!!!
#
##################################
ionic cordova platform remove ios
ionic cordova prepare ios
ionic cordova platform add ios
ionic cordova build ios --prod --release --buildFlag="-UseModernBuildSystem=0" --verbose
cd platforms
cd ios
open "MyApp.xcworkspace/"
cd ..
cd ..
It had be plaguing my project, so I thought I'd take them out. I am yet to deploy the project so far though... so who knows.
BigSur 11.1, XCode 12.4 (12D4e)
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.
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.