2

tl;dr; how to use old (what shouldn't use use_frameworks!) and new pods together in podfile?
I had working podfile:

platform :ios, '8.0'
use_frameworks!

    target 'myApp' do
        pod 'Alamofire', '1.3.1'
        pod 'SwiftyJSON', '~> 2.2.1'
    end

Then I added OneSignal pod according to documentation link
So my pod file changed to:

platform :ios, '8.0'
use_frameworks!

target 'myApp' do
    pod 'Alamofire', '1.3.1'
    pod 'SwiftyJSON', '~> 2.2.1'
    pod 'OneSignal'
end

I updated pods and run build - got error:

ld: framework not found OneSignal
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I checked OneSignal pod and it looks differently compared to others: enter image description here
Thats probably because is old style objective-c framework.
I can add this framework manually to my project but I wonder how to make it work properly with cocoapods? This issue relates to my problem I think https://github.com/CocoaPods/CocoaPods/issues/3338


Update
I'm currently using Xcode 6.4

4

1 回答 1

2

你使用的是什么版本的 Xcode?

如果更新到 Alamofire 和 SwiftyJSON 的最新版本并使用 Xcode 7 构建,它应该可以修复您的构建错误。

platform :ios, '8.0'
use_frameworks!

target 'myApp' do
    pod 'Alamofire', '2.0.2'
    pod 'SwiftyJSON', '~> 2.3.0'
    pod 'OneSignal'
end
于 2015-09-28T21:03:06.427 回答