Cocoa pods and Watchkit Extesion

大兔子大兔子 提交于 2019-12-03 08:02:44

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

The problem is when updating to cocoapods 0.36.x they are now creating Frameworks out of each pod library. See the blog post about it.

This causes issues with any pod library that is dependent on other pods and how its referencing them in their import statements, or how your code is importing them as well. The Pod process now turns them into frameworks and when they used to be imported as

#import "ThisOtherPodClass.h"

Now need to be imported as

#import <ThisPodsFrameworkName/ThisOtherPodClass.h>

There is a new version of cocoa pods .38, that is designed to support WatchKit. However, if you want to work with the current version, check o make sure that libPods.a is added to the Target, WatchKit Extension in Included Libraries and Frameworks. Second, make sure that Pods.debug and Pods.release are added to Watchkit Extension in the General tabl

https://github.com/CocoaPods/CocoaPods/issues/3382

neonichu commented on Apr 15, 2015 would start by making sure OTHER_LDFLAGS isn't overwritten with unnecessary things, both in the project and the targets.

That set OTHER_LDFLAGS in buids settings solved my issus.

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.

Try to change this lines

target :'My App', target :'My Team WatchKit Extension'

and remove colons:

target 'My App', target 'My Team WatchKit Extension'

I found a "temporally solution" for me: Switch back to CocoaPods 0.35

Now everything is working fine, with our any changes to my project / pod file (except removing the 'use_frameworks!')

I think, that should not be the final solution here...

A short test by upgrading again to 0.36 raises the same problem as before...

Here is a link to the GitHub Issue:

Rename the target so it doesnt include any spaces -> MyTeamWatchKitExtension both in podfile and also in General -> Targets. This solved my problem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!