加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – Xcode没有这样的模块

发布时间:2020-12-14 17:43:41 所属栏目:百科 来源:网络整理
导读:我想在 Swift中使用cocoapod Alamofire.但是,当我导入Alamofire时,我收到错误“No Such Module”我正在使用Xcode 7.2 Alamofire 3.0和Swift 2以下是我采取的步骤 1)在终端我跑了 $sudo gem install cocoapods 那时没有错误 2)我跑了 cd~ / Path / To / Folde
我想在 Swift中使用cocoapod Alamofire.但是,当我导入Alamofire时,我收到错误“No Such Module”我正在使用Xcode 7.2 Alamofire 3.0和Swift 2以下是我采取的步骤

1)在终端我跑了

$sudo gem install cocoapods

那时没有错误

2)我跑了

cd~ / Path / To / Folder / Containing / Project(一次在我运行的项目文件夹中)

pod init

3)然后

open -a Xcode Podfile

4)然后我补充说

source 'https://github.com/CocoaPods/Specs.git'
platform :ios,'8.0'
use_frameworks!

pod 'Alamofire','~> 3.0'

到Podfile

5)然后我跑了

pod 'Alamofire','3.0'

其次是

pod install

我将$(SRCROOT)添加到runpath和buildpath.

另外我发现这个答案No such module “Armchair”说添加预发布但我真的不明白如何做到这一点或者这是我的问题.也许这是显而易见的,但我是Swift的新手并且不理解.
Alamofire也应该出现在我的框架或pods文件夹中吗?它不在任何一个.
files in project

解决方法

在pod init之后,您必须使用新的< YourProject> .xcworkspace而不是< YourProject> .xcodeproj.

pod安装后,xcworkspace包含您的项目和pod.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读