pbaranski
pbaranski

Reputation: 25062

Cocoapods framework not found - mixed objective c and swift pods

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

Upvotes: 2

Views: 1228

Answers (1)

jkasten
jkasten

Reputation: 3948

What version of Xcode are you using?

If update to the latest release versions of both Alamofire and SwiftyJSON and build with Xcode 7 it should fix your build errors.

platform :ios, '8.0'
use_frameworks!

target 'myApp' do
    pod 'Alamofire', '2.0.2'
    pod 'SwiftyJSON', '~> 2.3.0'
    pod 'OneSignal'
end

Upvotes: 2

Related Questions