Symbol not found: _$s10Foundation10URLRequestV10httpMethodSSSgvg

Hi,

After adding a WidgetExtension (to add a lock screen widget) to my app, I've discovered that when running my app on a device <iOS16, I crash with a Symbol not found error in... Foundation.

dyld[99805]: Symbol not found: _$s10Foundation10URLRequestV10httpMethodSSSgvg
  Referenced from: /Users/thibauddavid/Library/Developer/Xcode/DerivedData/MyAppName-aesniykwuojsmyblczcqnpuiuuzk/Build/Products/DebugDevelopment-iphonesimulator/WidgetsExtensionEngine.framework/WidgetsExtensionEngine
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation
Symbol not found: _$s10Foundation10URLRequestV10httpMethodSSSgvg
  Referenced from: /Users/thibauddavid/Library/Developer/Xcode/DerivedData/MyAppName-aesniykwuojsmyblczcqnpuiuuzk/Build/Products/DebugDevelopment-iphonesimulator/WidgetsExtensionEngine.framework/WidgetsExtensionEngine
  Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 15.2.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/Foundation.framework/Foundation

How is that even possible ? I've double checked my widget mintarget version (iOS16), and that all my targets are using the same Swift version (5).

What else can I check ? When I encounter a similar error, it's always because a framework isn't embedded in host target, but there is no way Foundation could be missing. My widget extension is the only extension triggering this issue (NSE, Share etc works fine). I suspect it's because my WidgetExtension target has a min target version of iOS16, but it shouldn't event be embedded nor run in iOS15 devices.

Am I missing something ?

Any help appreciated

Answered by thibauddavid in 732722022

Update: Removing our widget engine 's framework from linked libraries in our host target solved the issue.

The info you posted is from the simulator. Do you see the same crash on a real device?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Edit: Tried linking binary WidgetsExtensionEngine.framework as optional in host target, same error. Also tried another branch without WidgetExtension, and setting up another extension to mintarget iOS16, and it also works.

@eskimo Yes, that's how we discovered that bug. An user reported the crash while using a TestFlight build on its device.

(I can't comment on your reply, my reply disappears as soon as I refresh the page, don't know why)

That crash appeared on my device (the crash is exactly the same, on application start) :

dyld[48209]: Symbol not found: ($s10Foundation10URLRequestV10httpMethodSSSgvg) Referenced from: '/private/var/containers/Bundle/Application/F1B20444-7852-438D-8C81-99FAC68948A0/MyApp.app/Frameworks/WidgetsExtensionEngine.framework/WidgetsExtensionEngine' Expected in: '/System/Library/Frameworks/Foundation.framework/Foundation' Symbol not found: ($s10Foundation10URLRequestV10httpMethodSSSgvg) Referenced from: '/private/var/containers/Bundle/Application/F1B20444-7852-438D-8C81-99FAC68948A0/MyApp.app/Frameworks/WidgetsExtensionEngine.framework/WidgetsExtensionEngine' Expected in: '/System/Library/Frameworks/Foundation.framework/Foundation'

Ok, this was an error on the project's configuration. We manually linked the application's binary to an internal framework that itself linked on the Widget framework.

Consider the problem solved.

Thanks for the time

Accepted Answer

Update: Removing our widget engine 's framework from linked libraries in our host target solved the issue.

Symbol not found: _$s10Foundation10URLRequestV10httpMethodSSSgvg
 
 
Q