使用cocoapods“use_frameworks!”时出错迅速 [英] error using cocoapods "use_frameworks!" SWIFT

查看:1483
本文介绍了使用cocoapods“use_frameworks!”时出错迅速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个干净利落的项目,使用了一些cocoapods:Parse,AFNetworking和RESideMenu。
我需要使用



使用use_frameworks时!在CocoaPods中,你所有的pod都将被用作框架,而不仅仅是swift pods。所以你不需要桥接头。只需将您的pod导入所需的所有swift文件即可。
在你的例子中你必须写:
import RESideMenu


I had a clean swift project, using some cocoapods : Parse, AFNetworking and RESideMenu. I need to use STZPopupView pod, so I updated cocoapods with the last version:

gem install cocoapods

Then I relaunched it for my project:

pod install

Because of this error :

[!] Pods written in Swift can only be integrated as frameworks; this feature is still in beta. Add `use_frameworks!` to your Podfile or target to opt into using it.

I updated my podfile adding "use_frameworks!"

My podfile is now:

# Uncomment this line to define a global platform for your project
# platform :ios, '8.0'
use_frameworks!

source 'https://github.com/CocoaPods/Specs.git'

target 'isam' do
pod 'RESideMenu', '~> 4.0.7'
pod 'AFNetworking', '~> 2.5'
pod 'Parse', '~> 1.6'
pod 'STZPopupView', '~> 1.0'
end

target 'isamTests' do

end

Since, I have 2 errors when I build :

  • "RESideMenu.h" file not found
  • Failed to import bridging header "..../isam/Swift-Bridging-Header.h"

I didn't changed anything else in my project.

My Swift-Bridging-Header.h doesn't change :

#ifndef isam_Swift_Bridging_Header_h
#define isam_Swift_Bridging_Header_h

#import <Parse/Parse.h>
#import <RESideMenu.h>

#endif

In my build settings, I have :

I think it's because of "use_frameworks!" in my podfile, but I don't know how to do to use all of my pods to build my app correctly.

EDIT :

The exact errors are :

/path_of_my_project/Swift-Bridging-Header.h:12:9: error: 'RESideMenu.h' file not found
#import <RESideMenu.h>
        ^
<unknown>:0: error: failed to import bridging header '/path_of_my_project/Swift-Bridging-Header.h'

解决方案

I'm actually on the same problem. You could try this: http://www.innerexception.com/2015/05/cocoapods-useframeworks-means-bridging.html

When using use_frameworks! in CocoaPods all of your pods will be used as frameworks, not only the swift pods. So you don't need an bridging header for this. Just import your pods into all swift files you need. In your example you have to write: import RESideMenu

这篇关于使用cocoapods“use_frameworks!”时出错迅速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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