可可豆荚和Watchkit扩展 [英] Cocoa pods and Watchkit Extesion

查看:105
本文介绍了可可豆荚和Watchkit扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试为我的应用程序构建一个WatchKit扩展...

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

我更新了pods文件,使其看起来像这样:

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)

我的问题在哪里?

推荐答案

我正在使用 Pod 1.2.1 >并面临相同的问题,即没有这样的模块 XYZ ,对于在这里遇到相同问题的任何人,我做了克服的工作:

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只是在每个目标下都添加了平台,例如 platform:watchos,'3.2'之前就缺少了,它解决了我的问题。

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

这篇关于可可豆荚和Watchkit扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆