问题
I am working on existing React-native project for iOS. I have followed the initial instructions from Getting Started and demo app is working fine.
But in existing project there is podfile. So in that project I have ran pod install
successfully.
Then when I open myIOSApp.xcworkspace
in XCode and run Project Build. The build got failed with 3 errors:
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.
The folder in which the myIOSApp.xcworkspace
exists, also has Podfile and Podfile.lock. I have tried almost all solution but this error is not going.
If I run react-native run-ios
, it opens iPhone simulator, but terminal exited with errors like:
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/myIOSApp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
I have tried several solutions, like: closing XCode, and then running pod install
, or Clearing Project Build from Product
menu, and rebuilding it. Or gem install cocoapods
or pod deintegrate
. Or deleting and Xcode/DerivedData
folder.
EDIT 1
Somehow PODS_PODFILE_DIR_PATH
& PODS_ROOTS
values were missing in User defined setting
in Target > Build Setting. I don't know why it was not set by default.
After this i am getting only 1 error:
lexical or preprocessor issue file not found
, throwing this error for lib that was installed by pod install
. Something like libname.h
file is not found.
But no luck. Any help here?
回答1:
The error is gone.
Check Edit 1 in question. PODS_PODFILE_DIR_PATH
& PODS_ROOT
variables were missing in User defined Build setting.
And also I was using different Pod
version. So I've installed Pod version 1.6.1
, the version that other developer used. And after that, all the above variable got set correctly. And build created successfully. So it was cocoapods
version issue.
来源:https://stackoverflow.com/questions/55797068/diff-podfile-lock-no-such-file-or-directory-react-native-xcode