当我使用CocoaPods时,“没有这样的模块” [英] 'No such module' when I use CocoaPods

查看:139
本文介绍了当我使用CocoaPods时,“没有这样的模块”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以这是我的程序。我在项目目录中创建了一个新的 Podfile ,然后我添加了以下内容

So here's my procedure. I create a new Podfile in the project directory, then I added the following

platform :ios, '9.0'
use_frameworks!

target 'CPod' do
pod 'AFNetworking', '~> 2.5'
pod 'ORStackView', '~> 2.0'
pod 'SwiftyJSON', '~> 2.1'
end 

我解雇 pod install ,一切顺利,打开 xcworkspace 。然后我转到 ViewController.swift 如果我尝试导入一个pod我得到没有这样的模块'SwiftyJSON' ,如果我要做导入SwiftyJSON 。任何想法?

I fire off pod install, and everything goes well, open up the xcworkspace. I then go over to ViewController.swift and if I try to import a pod I get No such module 'SwiftyJSON', if I were to do import SwiftyJSON. Any ideas?

编辑:SwiftyJSON是一个基于Swift的模块,而不是Obj-C

SwiftyJSON is a Swift based module, not Obj-C

推荐答案

尝试将 Pods 框架添加到构建方案并构建框架。构建之后,构建/运行项目。

Try adding the Pods framework to your build scheme and building the framework. After you've built it, build/run your project.

步骤:


  1. Scheme菜单> Manage Schemes> check Pods > Close(图片1 图片2

  2. 选择<$ c $方案菜单中的c> Pod 。

  3. 构建 Pods

  4. 从同一菜单中选择您的项目,然后构建/运行它。

  1. Scheme menu > Manage Schemes > check Pods > Close (Image 1, Image 2)
  2. Select Pods from the scheme menu.
  3. Build Pods.
  4. Select your project from the same menu, then build/run it.

这篇关于当我使用CocoaPods时,“没有这样的模块”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆