Related
After upgrading to Xcode 10.2 I am getting 2 errors
:-1: Unable to load contents of file list: 'xxxxx/Pods/Target Support
Files/Pods-xxxx/Pods-xxxxx-frameworks-Debug-input-files.xcfilelist'
(in target 'xxxxx')
:-1: Unable to load contents of file list: 'xxxxx/Pods/Target Support
Files/Pods-xxxxx/Pods-xxxxx-frameworks-Debug-output-files.xcfilelist'
(in target 'xxxxx')
I updated all my pod and changed build system to "Legacy Build System" but still getting the same build error
I struggled with this for several hours today and this is what finally worked for me:
sudo gem update cocoapods --pre
pod update
clean
build
From what I've read, this is an issue with the new build process that is enabled by default in Xcode 10.2 though I've not found the workaround clearly documented anywhere yet. There may be a more elegant solution than what I described.
delete 'Pods/', 'Podfile.lock', 'yourappname.xcworkspace'
pod deintegrate
pod install
it's work for me
I have encountered this problem every time, using the above method to solve, I do not know why, how to completely solve
To illustrate the answer of #nfranzmeier:
Go to your project:
Select the right target
Build Phases
Unfold [CP] Embed Pods Frameworks script phase
Remove the files under Input Files Lists and Output Files Lists sections by selecting each of them and clicking on the - button
And you're done!
None of the solutions above worked for me. What did the trick was:
Go to Xcode > Project > Info > Configurations
Set the values for Debug > Pods-XXX.debug and Release = Pods-XXX.release
This solved the issue for me on Xcode 12.0 beta
Just pod install fixes this.
You don't necessarily want to update your pods (especially if you have not locked in versions explicitly). We had this error after creating a new Scheme.
This solved my problem:
Open **Terminal**
1) run -> pod deintegrate
2) run -> pod install
In **Xcode**
3) Click Product Menu
4) Keep Pressing Option Button
5) Click Clean Build Folder
6) Run
This worked out for me:
cd ios && pod deintegrate
pod install
Then go ahead and rerun your project
I had changed the Run Configurations, from: Debug to DEV, but didn't change the Scheme:
On top left, select your project name, next to your device:
Then, select your project and click "Edit"
Last, change from Debug to your desired "Run configuration", in my case was DEV:
Do that, for every single one in the list on the left, but for Profile, leave that one as Release or your equivalent:
You can just edit your xxxx.xcodeproj/project.pbxproj file and delete the offending lines xxxinput-files.xcfilelist and xxxoutput-files.xcfilelist from the inputFileListPaths() outputFileListPaths() so they're empty again and then save it and rebuild
In my case the error happened when archiving the app.
The cause was that the wrong build configuration was selected in the build scheme. This happened after introducing xcconfig-files for staging environment.
How i fixed it:
select the build scheme in Xcode (next to the "play" button)
select product -> scheme -> edit scheme
check if the correct build scheme is selected
see here:
For me, this was caused because I was setting up a custom configuration (.xcconfig) file for different environments.
I wasn't importing the Pods/Target Support Files/Pods-XXXXXX/Pods-XXXXXX.release.xcconfig into my configuration file.
This guide helped me find the missing step.
https://thoughtbot.com/blog/let-s-setup-your-ios-environments
Thanks Patrick.
In my case
-> pod deintegrate
-> pod clean
-> pod install
then rebuild the project works fine.
My XCode = 11.3.1
cd ios
rm Podfile.lock
edit Podfile as below
# Uncomment this line to define a global platform for your project
platform :ios, '10.0'
>> Uncommented and bumped the version to 10
flutter clean
flutter pub get
pod repo update
pod update
For myself it works like that:
For example app name is "xyz"
click xyz(top) -> project(xyz)-> info -> configuration -> Debug -> xyz -> "Select Pods-xyz.debug"
xcode-13 or above
For me (using Mac Mojave) using the above solutions didn't work..
I manage to successfully overcome this issue by installing RVM on my Mac via:
curl -L https://get.rvm.io | bash -s stable --auto-dotfiles --autolibs=enable --rails
As described on this page.
And then re-install cocoapods via:
gem install cocoapods
And lastly run again:
pod install
I hope this helps someone who was stuck endlessly like me :)
I have the same issue and do the below steps and now am able to make build successful
go to Project->Configurations and set the valid configuration file for configuration.
if you see already set correct valid configuration file then do pod install
if you are not able see valid configuration file then pod install and Now you can see the valid configuration file just choose the right one now.
Note : I have this issue on Xcode 11.7
These are the steps that worked for me:
In the terminal, inside of project document, type:
pod update
If pod is not found, you should install Cocoapods:
sudo gem install cocoapods
If it returns a ruby/gem error, you should install (or reinstall) Ruby:
curl -L https://get.rvm.io | bash -s stable
rvm install ruby-2.7.2
sudo gem install cocoapods
Try to update pods again, and when it is finished, open .xcworkspace file.
I solve the cloud_firestore not found the issue as well by this after integrating a new version of that cloud_firestore.
(optional) update the podfile with the required version of cloud_firestore for fast compiling (saves 500k+ lines of execution).
delete 'Pods/', 'Podfile.lock', 'yourappname.xcworkspace'
pod deintegrate
pod install
If still have this problem and using flutter, you should open Runner Info Tab (in Xcode) set configuration file to None. then run pod deintegrate pod install.
I resolved this issue with....
Go to your Targets in xcode
Go to Build Phases
Next go to Run Script and check it has any files in input file lists or output file lists
Now, Remove files (input-files.xcfilelist / output-files.xcfilelist) using symbol - from Input file Lists and Output file Lists respectively
Try to go to your project directory.
Navigate to /ios
Remove Podfile.lock
Run project
Change build configuration from release mode to debug mode.
Getting this error while building a react-native iOS app on xcode.
Started getting this error after npm install and rpm linking react-native-fs library. But after searching online for a solution, I noticed that many people are getting the same error while installing other react native libraries.
A possible solution suggested by many is,
Adding the following under "Build Settings" -> "Header Search Paths".
$(SRCROOT)/../node_modules/react-native/React - (Recursive)
But no luck with this solution, still getting the same error
In my case this particular problem happened when I was trying to archive a 0.40+ react-native app for iOS (solution was found here: Reliable build on ^0.39.2 fails when upgrading to ^0.40.0).
What happened was that Xcode was trying to build the react-native libraries in parallel and was building libraries with implicit react dependencies before actually building the react library.
The solution in my case was to:
Disable the parallel builds:
Xcode menu -> Product -> Scheme -> Manage Shemes...
Double click on your application
Build tab -> uncheck Parallelize Build
Add react as a project dependecy
Xcode Project Navigator -> drag React.xcodeproj from Libraries to root tree
Build Phases Tab -> Target Dependencies -> + -> add React
Make sure you disable Parallelise Build and add React target above your target
QUICK FIX (not the best)
Change the import react-native header lines:
#import <React/RCTBridgeModule.h>
#import <React/RCTLog.h>
To:
#import "RCTBridgeModule.h"
#import "RCTLog.h"
Here is an example of changes I had to make for the library I was trying to use: Closes #46 - 'RCTBridgeModule.h' file not found.
Change
#import "RCTBridgeModule.h"
to
#import "React/RCTBridgeModule.h"
For me, this error occurred when I added a new scheme/target (app.staging) in the app and installed pods using pod install.
This issue is occurring due to pods are not shared for all targets. So I need to add newly added target (app.staging) inside the Podfile.
Here is my Podfile.
platform :ios, '9.0'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
target 'app' do
# Pods for app
pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
target 'appTests' do
inherit! :search_paths
# Pods for testing
end
# Pods for staging app // important line below
target 'app.staging'
use_native_modules!
end
For viewers who got this error after upgrading React Native to 0.40+, you may need to run react-native upgrade on the command line.
If Libraries/React.xcodeproj are red in xcode then reinstall node_modules
rm -rf node_modules && yarn
My newly created project from react-native 0.46.3 was red :S I have npm 5.3.0 and yarn 0.24.5 when I did react-native init
I ran into this issue after doing a manual react-native link of a dependency which didn't support auto link on RN 0.59+
The solution was to select the xcodeproj file under the Libraries folder in Xcode and then in Build Settings, change Header Search Paths to add these two (recursive):
$(SRCROOT)/../../../ios/Pods/Headers/Public/React-Core
$(SRCROOT)/../../../ios/Pods/Headers/Public
My solution was to remove everything in Libraries like described here
Latest releases of react-native libraries as explained in previous posts and here have breaking compatibility changes. If you do not plan to upgrade to react-native 0.40+ yet you can force install previous version of the library, for example with react-native-fs:
npm install --save -E react-native-fs#1.5.1
I was able to build a debug, but I was unable to build an archive.
I solved this issue by dragging React.xcodeproj found in /node_modules/react-native/React to my root directory in Xcode, then added React as a target dependancy in build phases > target dependencies.
After React Native 0.60 this issue is often caused by a linked library mixed with the new 'auto-linking' feature. This fixes it for me
Unlink old library using
$ react-native unlink react-native-fs
Refresh Pods integration entirely using
$ pod deintegrate && pod install
Now reload your workspace and do a clean build.
I receive this error in any new module I create with create-react-native-module. None of the posted solutions worked for me.
What worked for me was first making sure to run yarn in the newly created module folder in order to create node_modules/ (this step is probably obvious). Then, in XCode, select Product -> Scheme -> React instead of the default selection of MyModuleName.
This error appeared for me after I ran pod install command for the new dependencies. Along with those, React had also been installed. Therefore probably Xcode was confused for path. I removed these lines from PodFile and error was gone. Please note that those removed from here were already linked in Xcode.
target 'app' do
pod 'GoogleMaps'
pod 'Firebase/Auth', '~> 6.3.0'
pod 'Firebase/Database', '~> 6.3.0'
# Removed four pods below and it worked.
pod 'react-native-image-picker', :path => '../node_modules/react-native-image-picker'
pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
pod 'react-native-image-resizer', :path => '../node_modules/react-native-image-resizer'
pod 'RNFS', :path => '../node_modules/react-native-fs'
end
Go to iOS folder in your project and install pod -
$ pod install
If you are getting any error in installation of pod type command-
$ xcode-select -p
Result should be - /Applications/Xcode.app/Contents/Developer
If the path is incorrect then open your iOS project in Xcode and go to: Xcode->preferences->command line tools-> select Xcode
And again install the pod your issue will be fixed.
anhdevit's suggestion in https://github.com/facebook/react-native/issues/24363#issuecomment-488547280 worked for me:
In your terminal, run:
defaults delete com.apple.dt.Xcode
delete the pods folder and the .xcworkspace file
run pod install again in that directory
try to archive again and done
If you want to make it from your editor also open SMobile.xcscheme
And change parallelizeBuildables = "NO"
For me didn't work any from the above solutions and below it is what worked (I had already checked out Parallelize Build and added React)
1. Open XCode --> To Libraries add `$LibraryWhichDoesNotWork.xcodeproj$`
2. Then for your app in the `Build Phases` add to the `Link Binary with Libraries` the file `lib$LibraryWhichDoesNotWork$.a`
I've encountered this issue while upgrading from 0.58.4 to new react-native version 0.60.4. Nothing from what i found on the internet helped me, but I managed to get it working:
Go to build settings, search for 'Header search paths', select the entry, press DELETE button.
I had these values overriden, and looks like they fell back to defaults after deletion. Also Cocoapods was complaining about it with messages in Terminal after pod install:
[!] The `app [Release]` target overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Target Support Files/Pods-app/Pods-app.release.xcconfig'. This can lead to problems with the CocoaPods installation
If you want to keep Parallelise Build enabled and avoid the missing header problems, then provide a pre-build step in your scheme to put the react headers into the derived-data area. Notice the build settings are coming from the React project in this case. Yes it's not a thing of beauty but it gets the job done and also shaves a lot of time off the builds. The prebuild step output ends up in prebuild.log. The exact headers you'll need to copy over will depend on your project react-native dependencies, but you'll get the jist from this.
Get the derived data directory from the environment variables and copy the required react headers over.
#build_prestep.sh (chmod a+x)
derived_root=$(echo $SHARED_DERIVED_FILE_DIR|sed 's/DerivedSources//1')
react_base_headers=$(echo $PROJECT_FILE_PATH|sed 's#React.xcodeproj#Base/#1')
react_view_headers=$(echo $PROJECT_FILE_PATH|sed 's#React.xcodeproj#Views/#1')
react_modules_head=$(echo $PROJECT_FILE_PATH|sed 's#React.xcodeproj#Modules/#1')
react_netw_headers=$(echo $PROJECT_FILE_PATH|sed 's#React/React.xcodeproj#Libraries/Network/#1')
react_image_header=$(echo $PROJECT_FILE_PATH|sed 's#React/React.xcodeproj#Libraries/Image/#1')
echo derived root = ${derived_root}
echo react headers = ${react_base_headers}
mkdir -p ${derived_root}include/React/
find "${react_base_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_view_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_modules_head}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_netw_headers}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
find "${react_image_header}" -type f -iname "*.h" -exec cp {} "${derived_root}include/React/" \;
The script does get invoked during a build-clean - which is not ideal. In my case there is one env variable which changes letting me exit the script early during a clean.
if [ "$RUN_CLANG_STATIC_ANALYZER" != "NO" ] ; then
exit 0
fi
react-native version 0.67.4 (recently updated) This build error started to show up in ios.
I found under my project > Edit Scheme > Build
There was a reference to "React" but it indicated "Missing"
So I removed it (little - button) and added React back (little + button) via the popup which has a Pods folder and a "React" pod project present.
So it looks like react-native used to supply a project file that you would set as a build target in the scheme: /node_modules/react-native/ReactReact.xcodeproj
However with this newer version of react that project is not present, which would explain why building will fail if you have a native module bridge (its searching for header files that don't exist)
I no longer get the build error, but I haven't verified it works. Will update once I get a positive outcome (or a negative one for that matter). Even if this does fix it, I am not sure if this is the "right" way, but I'm certainly open to suggestions.
In my case, the wrong target was selected in podfile, after correcting that, I was good to go.
In my case, I removed the 'arm64' from the release section located under Excluded architectures in the targets project
What you can do to get it right is:
1) npm uninstall reat-native-fs to uninstall library
2)npm unlink react-native-fs to unlink the library
Now the library is successfully removed and now install the lib again in your project and this time link everything manually. Sometime automatic linking causes this error.
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)
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.
I've encountered an strange issue after installing RestKit with cocoapods.
after resolving RestKit dependency for my project with cocoapods and trying to build it, I face this error:
The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
I tried running pod install, but no change.
Here are some shots:
PODS:
- AFNetworking (1.3.3)
- RestKit (0.20.3):
- RestKit/Core
- RestKit/Core (0.20.3):
- RestKit/CoreData
- RestKit/Network
- RestKit/ObjectMapping
- RestKit/CoreData (0.20.3)
- RestKit/Network (0.20.3):
- AFNetworking (~> 1.3.0)
- RestKit/ObjectMapping
- RestKit/Support
- SOCKit
- RestKit/ObjectMapping (0.20.3)
- RestKit/Search (0.20.3):
- RestKit/CoreData
- RestKit/Support (0.20.3):
- TransitionKit (= 1.1.1)
- RestKit/Testing (0.20.3)
- SOCKit (1.1)
- TransitionKit (1.1.1)
DEPENDENCIES:
- RestKit (~> 0.20.0)
- RestKit/Search (~> 0.20.0)
- RestKit/Testing (~> 0.20.0)
SPEC CHECKSUMS:
AFNetworking: 61fdd49e2ffe6380378df37b3b6e70630bb9dd66
RestKit: 1f181c180105a92f11ec4f6cd7de37625e516d83
SOCKit: 2f3bc4d07910de12dcc202815e07db68a3802581
TransitionKit: d0e3344aac92991395d4c2e72d9c5a8ceeb12910
COCOAPODS: 0.29.0
I was able to fix that by updating CocoaPods.
I. Project Cleanup
In the project navigator, select your project
Select your target
Remove all libPods*.a in Build Phases > Link Binary With Libraries
II. Update CocoaPods
Launch Terminal and go to your project directory.
Update CocoaPods using the command pod install
After many attemps I managed to fix this problem. Variable ${PODS_ROOT} was not set and I do below trick.
Go to Build Phases -> Check Pods Manifest.lock and replace
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
to
diff "${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock" > /dev/null
It helps me.
I had been searching for hours and I found solutions as follow:
In my case, method 1 works.
Method 1:
choose the target > go to Build Phases > 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
If you remove all pods from your target in the Podfile, e.g.
target 'myTarget' do
pod 'great-stuff', '~> 4.0' // you deleted this last pod
end
you'll need to manually delete these builds steps from your Xcode target Build Phases:
Check Pods Manifest.lock
Copy Pod resources
Cocoapods (current stable version 0.37.2) does not perform this cleanup when you run pod install.
Removing pods from the project and re-installing worked for me.
There is nice GitHub repository that can completely remove the pods from the project.
Just keep the backup of your PodFile and run below commands.
gem install cocoapods-deintegrate
gem install cocoapods-clean
Go to the project directory and run pod deintegrate
Again run pod clean
Run pod install
Clean and run.
If you are seeing an error like the following:
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.
Then there's a problem with Cocoapods in your project. Sometimes cocoapods can get out of sync and you need to re-initiate cocoapods. You should be able to resolve this error by:
Deleting the Podfile.lock file in your project folder
Deleting the Pods folder in your project folder
Execute 'pod install' in your project folder
Do a "Clean" in Xcode
Rebuild your project
After changing target name
My problem was xcconfig with old target names.
Went to project file -> info -> configuration
Removed old xcconfig (both Debug & Release)
pod install
It would update to new ones.
Also if you had missing .h files that's the reason (pods header search path is in these xcconfig)
I found my solution: Run:pod update instead of pod install. The error was fixed!
Go to Build Phases -> Check Pods Manifest.lock
Replace
${PODS_ROOT}/Manifest.lock
with:
${SRCROOT}/Podfile.lock" "${SRCROOT}/Pods/Manifest.lock
Check in image :
First you have to understand what the Podfile.lock is then understand what the Manifest.lock is and where it's used.
The Podfile holds either the (optimistic or exact) versions of every dependency you have. The lock file holds only exact versions.
Once you do pod install all the pods get downloaded/installed into the /pods directory. You may want to commit them Or maybe not. That's up to your team. What's NOT up to your team is decide if they should commit the the Podfile.lock or not. That needs to be committed so every dev in the team can be sure they've got the exact same version.
So let's say you downloaded your team’s code. In your project's root directory you only have Podfile and Podfile.lock and the Pods directory wasn’t committed.
Then you do pod install to creat the Pods directory. Your snapshot of every pods’ version should match with the versions of all pods from the Podfile.lock.
CocoaPods has a safety check in place, to ensure matching versions
This is where the Manifest.lock comes into play. Manifest.lock is your local machine's lock created. It has to match with Podfile.lock that is generated by the last commit (that caused changes in for your pods) in your repo. If it doesn't match then something is messed up.
Docs on what the Manifest.lock file is:
# Manifest.lock: A file contained in the Pods folder that keeps track of
# the pods installed in the local machine. This files is used once the
# exact versions of the Pods has been computed to detect if that version
# is already installed. This file is not intended to be kept under source
# control and is a copy of the Podfile.lock.
I honestly can only think of one scenario in which the Manifest.lock and Podfile.lock would be out of sync:
I mean if you pull from main branch, then you get main's Podfile and lock file. If you then make a change to the Podfile and then run pod install, then you would be updating the Podfile.lock and Manifest.lock and will keep them in sync. No issues with this
Is this just so that if:
You and your team don’t commit the /Pods directory
You have merge conflicts in your Podfile or Podfile.lock but don’t realize it. Or you haven't committed both Podfile and Podfile.lock
Then given that Xcode doesn’t process the Podfile and Podfile.lock, then naturally your project can build successfully.
However if you go in an inspect your Build Phases of your targets you'd see the following
That script is documented here
# Adds a shell script build phase responsible for checking if the Pods
# locked in the Pods/Manifest.lock file are in sync with the Pods defined
# in the Podfile.lock.
#
# #note The build phase is appended to the front because to fail fast.
#
# #return [void]
What those lines do are: perform a diff and ensure that sure your Manifest.lock i.e. your local snapshot of all installed pod versions are equal to Podfile.lock i.e. your repo's current snapshot of all installed pod versions.
The fix is likely super simple, just make sure you Podfile is what you want. Then just run pod install. You have also somehow accidentally made changes to your Manifest.lock inside your /Pods directory (or as mentioned earlier maybe only committed the lock file but not the Podfile or vice versa). Deleting /Pods directory causes no harm. Just do a pod install after. Do not do pod update unless that's what you want.
Just make sure you never delete the Podfile.lock otherwise if you do pod install then it would update all dependencies to the latest version it can.
Also helpful to see and this video on lock files, CocoaPods docs on how the lock file is put to use differently for pod install vs. pod update and last see how all that logic is used in more detail
this artsy blog on checksums. It's worth noting that a single space will create a new checksum and can make things out of sync.
In my case, I got same error after integrating WatchKit app. To solve problem I needed to add both targets of WatchKit in Podfile:
target 'MyProject WatchKit App' do
platform :watchos, '2.0'
shared_pods
end
target 'MyProject WatchKit App Extension' do
platform :watchos, '2.0'
shared_pods
end
PS: Maybe this happened for me because I mistakenly installed pods for MyProject WatchKit App target initially.
Try to set up the correct target in Podfile and then run pod update or pod install
Can you try this:
Delete the Pods folder
Delete Podfile.lock
Run pod install
Clean + Build
Run this, and your errors will vanish
rm -rf Pods && gem install cocoapods && pod install
I encountered this issue with a misconfigured xcconfig file.
The Pods-generated xcconfig was not correctly #included in the customise xcconfig that I was using. This caused $PODS_ROOT to not be set resulting in the failure of diff "/../Podfile.lock" "/Manifest.lock", for obvious reasons, which Pods misinterprets as a sync issue.
For me the problem was that I made a new target in my app by duplicating an existing one, but forgot to add the target to the Podfile. For some reason, the cloned target did work for days without problems, but after a while it failed to build by this error. I had to create a new target entry for my cloned project target in the Podfile then run pod install.
If you download the project from github or copy from other place, then the dependencies library do not exists, there will be this issue.
You just need to cd to the project/project_name directory in terminal , use ls to check whether there is a Podfile file.
if there exists the Podfile, you just need to install the dependencyies:
pod install
My working answer is:
Install update your cocoapods by this command:
pod update
Install your new pods by this command.
pod install
Last one command:
sudo gem install cocoapods.
The steps that worked for me (XCode 8.3.3/XCode 9 beta with a Swift 3.1 project)
- Navigate to your project directory
- pod install //which then asks you to do the next step
- pod repo update //takes a while to update the repo
- pod update
- pod install
- Close Xcode session
- Open and Clean the project
- Build/Run
Also make sure you open the .xcworkspace file rather than the project file (.xcodeproj) when working with pods. That should solve any errors with linking such as "Apple Mach -O Linker command failed"
Please do the following steps:
1: Deleting the Podfile.lock file in your project folder
2: Deleting the Pods folder in your project folder
3: Execute 'pod install' in your project folder
4: Do a "Clean" in Xcode
5: Rebuild your project
I tried everything, but the problem persisted.
After that I did this and it worked ASAP (As Smooth As Possible).
Open the .xcworkspace file.
Change to legacy build system if using Cordova on Xcode 10.
Go to target/project of Podfile. Select Deployment traget as 11+
Then Change the debug and release to Pods-.build/release. It was App.debug/release in my case.Pic attached. Hope it helps.
Completely nothing worked out for me from these answers. Had to create the project again by running cordova platform add ios. What I've noticed, even freshly generated project with (in my case) Firebase pods caused the error message over and over again. In my opinion looks like a bug for some (Firebase, RestKit) pods in Xcode or CocoaPods. To have the pods included I could simply edit my config.xml and run cordova platform add iOS, which did everything for me automatically. Not sure if it will work in all scenarios though.
Edit: I had a Podfile from previous iOS/Xcode, but the newest as of today have # DO NOT MODIFY -- auto-generated by Apache Cordova in the Podfile. This turned on a light in my head to try the approach. Looks a bit trivial, but works and my Firebase features worked out.
This made my day!
Deleting the Podfile.lock file in your project folder
Deleting the Pods folder in your project folder
Execute pod install in your project folder
Do a "Clean" in Xcode
Rebuild your project
Check Pods target and Runner target thats have to be same
1- Runner
2- Pods
Remove Pods.framework in:
Folder named Pods
Linked Frameworks and Libraries
And delete all new inputed lines from #main file App for ios
When you do
pod install --verbose
make sure:
1- you are in the correct directory. Most times, when a github project is downloaded, there will be a master folder. You need to be inside the actual project name folder(masterfolder/project folder) in the terminal before you invoke pod install --verbose
2- Delete the old pod lock folder then clean the project using xcode clean & do pod install.
3- Keep your rvm updated.
My problem was the cocoa pods version so I installed the latest with:
sudo gem install cocoapods --pre
Then pod update
That worked for me
If you are applying to the way Project Cleanup and your project still error.
You can go to tab Build Phases and then Find Check Pods Manifest.lock and remove the script.
Then type command to remove folder Pods like that rm -rf Pods
and then you need to remove Podfile.lock by command rm Podfile.lock
Probably, base on a situation you can remove file your_project_name.xcworkspace
Finally, you need the command to install Pod pod install --repo-update.
Hopefully, this solution comes up with you. Happy coding :)
I had same error. First I update cocoapods using
sudo gem install cocoapods
then install pods using Pod install command worked for me.
For me, working in flutter, the configuration was not automatically added due the existing configuration.
Adding #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig" to Flutter/Release.xcconfig and Flutter/Debug.xcconfig
solved the issue.