WatchKit framework not found Xcode 11 WatchOS < 6.0

I'm running into troubles trying to run our watch extension on watch os earlier than 6.0

Building with Xcode 11 and 11.1 GM I'm getting this error



dyld: lazy symbol binding failed: Symbol not found: _WKExtensionMain
  Referenced from: /Users/user_name/Library/Developer/CoreSimulator/Devices/6F81785F-6ABF-4DD4-9093-69B480C85EBD/data/Containers/Bundle/Application/3D626EF1-071C-47C3-92EF-06CB3A2AF664/AppName watchOS3.app/PlugIns/AppName watchOS3 Extension.appex/AppName watchOS3 Extension
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 5.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WatchKit.framework/WatchKit


dyld: Symbol not found: _WKExtensionMain
  Referenced from: /Users/user_name/Library/Developer/CoreSimulator/Devices/6F81785F-6ABF-4DD4-9093-69B480C85EBD/data/Containers/Bundle/Application/3D626EF1-071C-47C3-92EF-06CB3A2AF664/AppName watchOS3.app/PlugIns/AppName watchOS3 Extension.appex/AppName watchOS3 Extension
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS 5.0.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WatchKit.framework/WatchKit



We have no problem running on watch os 6.0 with Xcode 11

I've tried to embed WatchKit.framework in the 'General' tab and link it in build phases but still getting the same result

Replies

Hey @sorenzi. Did you manage to figure this out? We're encountering the same issue.

Had the same problem, found the solution in Xcode 11 changelog:

Set the

__WKEXTENSIONMAIN_LEGACY_TARGET_5_3
build setting to "legacy"


https://developer.apple.com/documentation/xcode_release_notes/xcode_11_release_notes