Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoa pods and Watchkit Extesion

I try to build a WatchKit Extension for my app...

I Updated the pods file to look like this:

platform:ios, '8.0'
use_frameworks!
source 'https://github.com/CocoaPods/Specs.git'

link_with 'my-team-ios', 'My Team WatchKit Extension'

def shared_pods
    pod 'DOSingleton'
    pod 'JSONModel'
    pod 'MagicalRecord'
end

target :'My App' do
    shared_pods
    pod 'Facebook-iOS-SDK', '~> 3.23.1'
    pod 'Reveal-iOS-SDK', :configurations => ['Debug']
    ... some more pods here...
end

target :'My Team WatchKit Extension' do
    shared_pods
end

How I install the pods and don't get an error...

But, when I build the App, I get this error:

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

What is my problem here?

like image 571
Urkman Avatar asked Apr 08 '15 15:04

Urkman


2 Answers

I'm using Pod 1.2.1 and facing the same problem i.e. No such module XYZ and for anyone who came across the same issue here what I did to overcome it:

use_frameworks!

def shared_pods
    pod 'XYZ'
end

target 'MyApp' do
    platform :ios, '8.0'

    shared_pods

    pod 'Blah'
    pod 'blah'

end

target 'Watch Extension' do
    platform :watchos, '3.2'
    shared_pods 
end

I just added platform under each target e.g platform :watchos, '3.2' which was missing before and it solved my problem.

like image 65
Muhammad Umair Avatar answered Sep 18 '22 10:09

Muhammad Umair


You need to open the xcworkspace file instead of the project file when using CocoaPods.

like image 33
Rhythmic Fistman Avatar answered Sep 21 '22 10:09

Rhythmic Fistman