我正在开发适用于 iOS 的现有 React-native 项目。我已按照最初的指示进行操作入门 https://facebook.github.io/react-native/docs/getting-started.html演示应用程序工作正常。
但现有项目中有podfile。所以在那个项目中我跑了pod install
成功地。
然后当我打开时myIOSApp.xcworkspace
在 XCode 中并运行 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
菜单,并重建它。或者gem install cocoapods
or pod deintegrate
。或者删除和Xcode/DerivedData
folder.
EDIT 1不知何故PODS_PODFILE_DIR_PATH
& PODS_ROOTS
中缺少值User defined setting
在“目标”>“构建设置”中。我不知道为什么它没有默认设置。
之后我只收到 1 个错误:lexical or preprocessor issue file not found
,对于安装的 lib 抛出此错误pod install
。就像是libname.h
未找到文件。
但没有运气。这里有什么帮助吗?