找不到CocoaPods桥接头文件

迈克尔·艾略特

这里是新开发人员,我目前正在迅速构建一个应用程序。我们正在使用cocoapods,但是在运行pod install之后,在objective-c桥接头中收到错误消息,指出找不到文件,但对于桥接头中的每个文件都找不到。例如,我们使用DateTools。我们在安装的桥接头中Pod安装它:#import <DateTools/DateTools.h>但是,在运行时,它出错了,说'Datetools/Datetools.h' file not found我已经看过很多其他类似的文章(例如thisthisthis),但是没有一个解决了这个问题。任何帮助将不胜感激!

大卫·希克

使用时use_frameworks在Cocoapods中的说明中,在Swift中导入Objective-C Pod不需要桥接头。

只需将所需的pod设置到podfile中:

#Uncomment this line to define a global platform for your project
platform :ios, '9.0'
#Uncomment this line if you're using Swift
use_frameworks!

target 'YourProject' do

#Swift Pods
pod 'Alamofire'
pod 'ActiveLabel'

#ObjC Pods
pod 'IDMPhotoBrowser'
pod 'Firebase'

#This stuff is to set the SWIFT_VERSION
post_install do |installer|
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['SWIFT_VERSION'] = '2.3'
        end
    end
end
end

运行pod install运行pod update(这不是必需的,但是由于某种原因,即使是在全新安装之后,我几乎每次都得到更新)。关闭Xcode,然后使用白色xcworkspace文件重新打开

在此处输入图片说明

import Alamofire
import ActiveLabel 
import IDMPhotoBrowser
import Firebase

做完了

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章