CLKFullColorImageProvider & watchOS 5 Complications

I can get the four new full color watch complications to work fine with the Watch Series 4 simulator and watchOS 5, but when run with a Watch Series 3 and watchOS 4 on either the simulator or an actual watch the watch App crashes - even when the code is enclosed in "if (@available(watchOS 5.0, *)) { }".


I get the following error:


"dyld: Symbol not found: _OBJC_CLASS_$_CLKFullColorImageProvider

Referenced from: /Volumes/Data HD/Development/Developer/CoreSimulator/Devices/EFA36F69-48F8-4E81-AA9E-D30CDE10A652/data/Containers/Bundle/Application/49ECDC51-1814-40AC-A99D-83F11CF742A1/HereIAmWatch.app/PlugIns/HereIAmWatch Extension.appex/HereIAmWatch Extension

Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 4.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/ClockKit.framework/ClockKit

in /Volumes/Data HD/Development/Developer/CoreSimulator/Devices/EFA36F69-48F8-4E81-AA9E-D30CDE10A652/data/Containers/Bundle/Application/49ECDC51-1814-40AC-A99D-83F11CF742A1/HereIAmWatch.app/PlugIns/HereIAmWatch Extension.appex/HereIAmWatch Extension

(lldb)"


When I comment out all of the lines of code with CLKFullColorImageProvider I can get the watch app to run OK with a Watch Series 3 and watchOS 4, but then the graphics will not load in watchOS 5.


The following is some of my code:


case CLKComplicationFamilyGraphicCircular: {

if (@available(watchOS 5.0, *)) {

CLKComplicationTemplateGraphicCircularImage * template = [[CLKComplicationTemplateGraphicCircularImage alloc] init];

template.imageProvider = [CLKFullColorImageProvider providerWithFullColorImage:[UIImage imageNamed:@"graphicCircularImage"]];

handler(template);

} else {

// Fallback on earlier versions

handler(nil);

}

break;

}

Replies

I am having the same issue. In swift trying to run on a Series 2 GPS watch running watchOS 4.3.


I get this on load:

dyld: Symbol not found: _OBJC_CLASS_$_CLKFullColorImageProvider


All the compications have images in the xcassests.

I thought this issue has been fixed but apparently it's still there in Xcode 10 .

Just add the ClockKit.framework as an optional library under Build Phases/Link Binary With for your watch extension project.

Thanks LarryL. This works!

This also fixed my problem. I had ClockKit.framework required and not optional.

Thanks LarryL,


The optional setting helped me too.

Obscure

Great LarryL


You are our savior !!!

Thank you. It works for me too.