差异:/Podfile.lock:没有这样的文件或目录-React Native-Xcode

时间:2019-04-22 15:47:29

标签: ios reactjs xcode react-native cocoapods

我正在为iOS开发现有的React-native项目。我遵循了Getting Started的最初指示,演示应用程序正常运行。

但是在现有项目中有podfile。因此,在该项目中,我成功运行了pod install。 然后,当我在XCode中打开myIOSApp.xcworkspace并运行Project Build时。构建失败,出现3个错误:

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.

myIOSApp.xcworkspace所在的文件夹也具有Podfile和Podfile.lock。我已经尝试了几乎所有解决方案,但是此错误不会消失。

如果我运行react-native run-ios,它将打开iPhone模拟器,但是终端退出并显示以下错误:

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

我尝试了几种解决方案,例如:关闭XCode,然后运行pod install,或从Product菜单中清除Project Build,然后重新构建。或gem install cocoapodspod deintegrate。或删除和Xcode/DerivedData文件夹。

编辑1 在“目标”>“构建设置”中的PODS_PODFILE_DIR_PATH中丢失了PODS_ROOTSUser defined setting值。我不知道为什么默认情况下未设置它。 在此之后,我仅收到1个错误: lexical or preprocessor issue file not found,并向pod install安装的lib抛出此错误。找不到类似libname.h的文件。

但是没有运气。这里有帮助吗?

1 个答案:

答案 0 :(得分:0)

错误消失了。

选中有问题的编辑1 。用户定义的构建设置中缺少PODS_PODFILE_DIR_PATHPODS_ROOT变量。

我还使用了不同的Pod版本。因此,我已经安装了Pod版本1.6.1,这是其他开发人员使用的版本。然后,上述所有变量均已正确设置。并建立成功创建。这就是cocoapods版本的问题。

相关问题