ios - 安装 CocoaPods 后的 Xcode 错误 - 没有这样的文件或目录

标签 ios cordova cocoapods

我在尝试将 Pod 添加到我的 Cordova iOS 项目时遇到一些错误

我在 Xcode 中看到的错误是:

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.

我根据在其他 Stackoverflow 上看到的信息尝试了以下操作。

1:关闭 Xcode 并运行 pod install

2:pod更新

3:删除并重新安装 cocoa pod

4:创建一个新项目

我的项目具有 /platform/ios 结构,我正在尝试安装 Firebase。这就是我安装 Pod 所做的事情

1:在上面的文件夹中 -- pod init 2:编辑podfile并添加firebase podfile 内容

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'RandstadJobs' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for RandstadJobs
pod 'Firebase/Core'
end

3:运行 pod install

4:干净地打开 Xcode 并构建

我看到了 Podfile.lock 和 Manifest.lock 文件。它们位于文件夹中,,

/platform/ios/Podfile.lock and /platform/ios/pods/manifest.lock

这是 Xcode 中的构建阶段设置

diff "${PODS_PODFILE_DIR_PATH}/Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
    # print error to STDERR
    echo "error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation." >&2
    exit 1
fi
# This output is used by Xcode 'outputs' to avoid re-running this script phase.
echo "SUCCESS" > "${SCRIPT_OUTPUT_FILE_0}"

路径似乎没有设置。

您能否提供一些提示以及如何解决此问题

谢谢

最佳答案

通过执行以下操作,我能够通过错误:

在 Xcode build设置中添加 2 个用户定义变量

1: PODS_ROOT = $(SRCROOT)/PODS

2: PODS_PODFILE_DIR_PATH = $(SRCROOT)

然后清理项目并编译

关于ios - 安装 CocoaPods 后的 Xcode 错误 - 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49382961/

相关文章:

java - Cordova 插件公开 JS 变量 (Android) (CardFlight)

ios - 如何确定使用 hyperloop 的 cocoapod 的正确 require 语句是什么?

ios - 无法通过 'pod install' 命令安装库

swift - 如何将 FMDB 与 cocoapods 和 swift 一起使用?

ios - 如何改变UICollectionView的填充方向?

ios - 使用 UIScrollView 水平滚动带有 20 个文本框的 View

ios - 如何在 ios 中的应用程序中播放 RTSP url

objective-c - 变量参数列表中的非 POD 类型

java - Roadblock 在 Windows 上为 Android 设置我的 Phonegap 环境

html - 在使用 PhoneGap 构建的 iOS 应用程序中可以选择 div 标签