Reputation: 91
This question, from a year ago, never got an answer:
Xcode /Podfile.lock: No such file
I am having exactly the same issue. I'd like to re-open the question.
I have a Cordova/Ionic app, which also uses Firebase, via CocoaPods.
I've never worked with any of this tech before, I'm simply taking over the project because the original developer left. I don't know anything about Cordova or Ionic or Mac iOS.
I ran:
pod install
and that ran without error. If I do:
ls -alhrt platforms/ios/
I see:
pods-release.xcconfig
pods-debug.xcconfig
..
cordova
www
platform_www
CordovaLib
.gitignore
Cher
frameworks.json
pods.json
Cher.xcworkspace
ios.json
build
.DS_Store
Podfile
Cher.xcodeproj
.
Pods
Podfile.lock
So the file "Pods" exists, and also "Podfile.lock".
However, if I open this project in Xcode, and try to build, I get the error:
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.
This error is common and when I searched on Google, there were dozens of pages addressing this issue. For instance:
Which suggests:
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
I've done this repeatedly, but I still get the same error.
Again, if I use the ls
command, I can see the file Podfile.lock
but Xcode continues to complain that the file doesn't exist.
I believe the solution is something similar to what they tried here:
PODS_PODFILE_DIR_PATH and PODS_ROOT not defined
https://discuss.multi-os-engine.org/t/pods-podfile-dir-path-and-pods-root-not-defined/823
If I do:
grep -iR PODS_ROOT *
I see:
Cher.xcodeproj/project.pbxproj: "${PODS_ROOT}/FirebaseInvites/Resources/GINInviteResources.bundle",
Cher.xcodeproj/project.pbxproj: "${PODS_ROOT}/FirebaseInvites/Resources/GPPACLPickerResources.bundle",
Cher.xcodeproj/project.pbxproj: "${PODS_ROOT}/GTMOAuth2/Source/Touch/GTMOAuth2ViewTouch.xib",
Cher.xcodeproj/project.pbxproj: "${PODS_ROOT}/GoogleSignIn/Resources/GoogleSignIn.bundle",
Cher.xcodeproj/project.pbxproj: "${PODS_ROOT}/Manifest.lock",
So if PODS_ROOT is empty, that would explain why Xcode can not find Manifest.lock.
But where and how do I set PODS_ROOT?
Upvotes: 0
Views: 1880
Reputation: 91
The solution is here:
PODS_ROOT and other pods env variables not set when compiling Ionic app
So, in short, this was fixed by removing the iOS project:
ionic cordova platform rm ios
And re-adding it:
ionic cordova platform add ios
And then building:
ionic cordova run ios --device
But make sure you already have Cocoapods installed on your system first.
Upvotes: 2