본문 바로가기
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:

by 루에 2015. 9. 8.
반응형

[!] 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:


외부 라이브러리를 추가할 때 cocoapods를 이용하다보면 이런 메세지를 보는 경우가 있다.

제대로 추가도 안되거니와, .lock파일이 생성이 안된다.


이유는 명확. 써 있는 대로 use_frameworks! 를 Podfile에 추가하면 된다.


# Uncomment this line to define a global platform for your project

# platform :ios, '6.0'

pod ‘Google/CloudMessaging’

pod ‘CryptoSwift’


use_frameworks!


target 'webviewtest' do


end


target 'webviewtestTests' do


end


이런식으로. 그래야 되는 이유는,

Add "use_frameworks!" to your Podfile because: 

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.

Reference: http://blog.cocoapods.org/CocoaPods-0.36/

를 참조하면 된다.



반응형

댓글