CocoaPods问题汇总

1.Pods written in Swift can only be integrated as frameworks; add use_frameworks!


在使用cocoapod导入Swift第三方时出现这样的问题:

Pods written in Swift can only be integrated as frameworks; add use_frameworks!
to your Podfile or target to opt into using it. The Swift Pod being used is: Charts

一开始我安装oc的配置方法:

platform :ios, '8.0'
pod 'Charts', '~> 2.1.6'

果报错了。
链接:大神文章链接

Because Apple doesn't let you build static libraries that contain Swift. Unlike Objective-C, Apple doesn't ship the Swift standard runtime libraries with iOS. This decouples the language version from the platform version. When you build an app with Swift, you're responsible yourself to ship them. By default, Xcode uses swift-stdlib-tool to handle copying the Swift runtime dylibs, but the tooling falls short when attempting to ship frameworks that use Swift with an app that is Objective-C only. Your app executable and the frameworks you ship will all use the same set of dylibs, which are embedded into the Frameworks subdirectory of the application bundle.First, that's because you can't link against different versions of the standard libraries. Furthermore it is desirable to embed them only once and not multiple times, because of constraints to memory size and network speed, which are relevant for distribution. You can make CocoaPods integrate to your project via frameworks instead of static libraries by specifying use_frameworks!. If that's not present, you won't be able to integrate dependencies, if you depend on a pod which includes Swift source code.

英文不好是硬伤啊,大概意思是:苹果不允许建包含swift的静态库,不同于OC可以使用平台版本的语言版本。 针对这种问题,可以做这样的处理:

platform :ios, '8.0'
pod 'Charts', '~> 2.1.6'
use_frameworks!

这样就可以了

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • PLEASE READ THE FOLLOWING APPLE DEVELOPER PROGRAM LICENSE...
    念念不忘的阅读 13,568评论 5 6
  • 宜:沐浴、捕捉、畋猎、结网、取渔。 忌:祭祀、嫁娶、入宅、作灶、安葬。 本日劫煞运是透出,对于单身女性来讲、容易出...
    季花女阅读 420评论 0 0
  • 今天,中国首部3D战争电影《钢刀》上映。 评分,不出意外。 内地市场在狂奔,但内地战争片,一直停滞。 这十年,扒开...
    Sir电影阅读 1,025评论 2 21
  • 国庆末尾的这几天老是和mama发生争执 平时她说我懒或者其他的我都无所谓 可是只要她一讲我不学习或者这样玩下去怎么...
    bibobibo_4bfe阅读 139评论 0 0