无法通过 CocoaPods 安装 ResearchKit(ResearchKit 已经存在)
Posted
技术标签:
【中文标题】无法通过 CocoaPods 安装 ResearchKit(ResearchKit 已经存在)【英文标题】:Cannot Install ResearchKit through CocoaPods (ResearchKit Already Present) 【发布时间】:2021-02-02 20:46:45 【问题描述】:我正在尝试安装 ResearchKit 以支持我正在开发的 ios 应用程序项目,但我无法使用 CocoaPods 安装它。尽管我尽了最大努力进行安装,但我的项目在其中一个文件的 import ResearchKit
行上失败,并出现错误,表明无法找到 ResearchKit。
基本系统信息:
MacOS 10.14.6 Xcode 11.3.1 (11C504) CocoaPods 1.9.3为了安装 CocoaPods,我在命令行运行 $ pod install
命令。 ResearchKit 在我的 Podfile 中引用如下:
pod 'ResearchKit', '2.0.0'
运行$ pod install
会产生以下结果:
Installing ResearchKit (2.0.0)
[!] Error installing ResearchKit
[!] /usr/bin/git clone https://github.com/ResearchKit/ResearchKit.git /var/folders/zg/v1h_8jdj5p77k3b208xfl_540000gn/T/d20201019-18654-1lebm6x --template= --single-branch --depth 1 --branch 2.0.0
Cloning into '/var/folders/zg/v1h_8jdj5p77k3b208xfl_540000gn/T/d20201019-18654-1lebm6x'...
Note: checking out 'b46a5f4d8350549918c8aae7d16b67dcb73fbff9'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
git-lfs filter-process: git-lfs: command not found
fatal: the remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
[!] Automatically assigning platform `iOS` with version `13.1` on target `Master-Sample` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
不过,我确信 ResearchKit 存在于我的系统中,因为运行 $ pod search ResearchKit
会产生:
-> ResearchKit (2.0.0)
ResearchKit is an open source software framework that makes it easy to create
apps for medical research or for other research projects.
pod 'ResearchKit', '~> 2.0.0'
- Homepage: https://www.github.com/ResearchKit/ResearchKit
- Source: https://github.com/ResearchKit/ResearchKit.git
- Versions: 2.0.0, 1.5.2, 1.5.0, 1.4.1, 1.3.1, 1.3.0, 1.2.1, 1.2, 1.1.2,
1.0.0 [trunk repo]
关于为什么 ResearchKit 安装在执行 $ pod install
命令期间失败,和/或为什么,如果它安装在我的系统上,我的项目找不到它的任何建议?
提前感谢您! ????
【问题讨论】:
【参考方案1】:已解决 - 我需要安装 git-lfs。 (https://github.com/ResearchKit/ResearchKit/issues/1219)。
【讨论】:
以上是关于无法通过 CocoaPods 安装 ResearchKit(ResearchKit 已经存在)的主要内容,如果未能解决你的问题,请参考以下文章