[英]Build error when using both objective-c and swift libraries with Cocoapods
I have an Objective C project which has a podfile like this: 我有一个Objective C项目,该项目具有如下所示的podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'Linbik' do
pod 'AFNetworking', '~> 2.6.0'
pod 'DateTools', '~> 1.6.1'
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-swift.git', :tag => '2.1.3'
end
DateTools
is an Objective C library, and Sentry
is a Swift one. DateTools
是一个Objective C库,而Sentry
是一个Swift库。 If I remove Sentry
pod and use_frameworks!
如果我删除Sentry
pod和use_frameworks!
line, and then run pod install
, pods are correctly installed and project builds just fine. 行,然后运行pod install
,正确安装了pod install
,项目构建就很好了。
But if I run pod install
with the podfile above, pods are correctly installed but I can't build the project. 但是,如果我使用上面的podfile运行pod install
,就可以正确安装pod install
,但是无法构建项目。 It gives me an error like this: 它给我这样的错误:
'NSDate+DateTools.h' file not found with <angled> include; use "quotes" instead
The import is done like this: 导入是这样完成的:
#import <NSDate+DateTools.h>
This is just part of the code that gives me an error. 这只是给我一个错误的代码的一部分。 There are also some imports like this: 也有一些这样的进口:
#import <AFNetworking/UIImageView+AFNetworking.h>
That gives the same error. 那给出了同样的错误。
Xcode suggests me to use double quotes on import, but that doesn't help. Xcode建议我在导入时使用双引号,但这无济于事。 What can I do? 我能做什么?
Change pod 'AFNetworking', '~> 2.6.0' And use this 更改pod'AFNetworking','〜> 2.6.0'并使用它
pod 'AFNetworking', '~> 3.0
pod 'DateTools', '~> 1.6.1'
pod 'Sentry', :git => 'https://github.com/getsentry/sentry-swift.git', :tag => '2.1.3'
我通过删除派生数据找到了解决方案。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.