Apple Watch App - Invalid Swift entry point data

For iOS 14 and watchOS 7.0, I completely recoded and modernized my app using Swift (was Objective C). I am almost done and am most proud of the job, but I have this issue that I need to fix on the Apple Watch app. I am not able to transfer data to the Apple Watch from the iPhone and get the following console messages. (The [xxx:xxxxxx] are my modification of the console messages.). I am guessing that the first 2 messages are the thing I need to fix and I need to fix this issue before I submit the app.

2020-09-24 08:29:02.873423-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data

2020-09-24 08:29:02.874413-0400 WatchApp Extension[xxx:xxxxxx] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.

2020-09-24 08:29:04.001368-0400 WatchApp Extension[xxx:xxxxxx] [WC] denying activation due to missing delegate

ExtensionDelegate: your iphone is Reachable

ExtensionDelegate: Session activated

2020-09-24 08:29:10.884500-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

2020-09-24 08:29:15.046379-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate

2020-09-24 08:29:15.047176-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate

2020-09-24 08:29:15.047860-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate

2020-09-24 08:29:15.782075-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

2020-09-24 08:29:24.390293-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

2020-09-24 08:31:57.059417-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

2020-09-24 08:32:00.055282-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

InterfaceController: your iphone is Reachable

2020-09-24 08:32:00.058230-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

2020-09-24 08:32:08.427192-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated

2020-09-24 08:32:13.374677-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate

2020-09-24 08:32:13.375717-0400 WatchApp Extension[xxx:xxxxxx]] [WC] WCSession is missing its delegate

2020-09-24 08:32:13.376426-0400 WatchApp Extension[xxx:xxxxxx] [WC] WCSession is missing its delegate

2020-09-24 08:32:51.861915-0400 WatchApp Extension[xxx:xxxxxx] [WC] already in progress or activated
Answered by SpaceMan in 637118022
Well, I fiddled with it and it works now. I'm not exactly sure what I did, but the Watch App component of my app is working. Also, I cancelled my request for tech help.
I am also getting this same error message - Invalid Swift
Code Block
2020-09-25 19:35:46.281502-0400 XXXX WatchKit Extension[1012:18958] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
2020-09-25 19:35:46.282071-0400 XXXX WatchKit Extension[1012:18958] [default]
lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.

And when the program then tries to access the WatchKit ExtensionDelegate I get nil

Perhaps this is a bug. I have a code request made to Apple for help. Used one of my 'get out of jail cards' to do it. We'll see what happens.
Do you have WKExtensionDelegateClassName with value $(PRODUCT_MODULE_NAME).ExtensionDelegate in your extension's Info.plist file? And the delegate adaptor in the App:

Code Block
@main
struct Mypp: App {
   @WKExtensionDelegateAdaptor(ExtensionDelegate.self) var extensionDelegate

Latter produces a SwiftLint warning though:

Code Block
Weak Delegate Violation: Delegates should be weak to avoid reference cycles. (weak_delegate)



Adding weak produces an error. Don't know what to do with this, so currently I have to live with the warning.
AndyJJ, yes, I have WKExtensionDelegateClassName with value $(PRODUCTMODULENAME).ExtensionDelegate in the extension's Info.plist, but I do not have the delegate adaptor in the AppDelegate. I created a project from scratch and added the watch target and it didn't generate a delegate adaptor. I'm not sure where that comes from. I am not using SwiftUI, just Swift.
Accepted Answer
Well, I fiddled with it and it works now. I'm not exactly sure what I did, but the Watch App component of my app is working. Also, I cancelled my request for tech help.
Same here. My app is built by objective-c and it used to work well.
Same error here:

lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.

Only started occurring since upgrade to Xcode 12.
hey, SpaceMan, how did you fiddle it to make it work? can you share your solution? I think this suppose a serious issue because many ppl stuck with this after upgrading to watchOS 7 and Xcode 12.
Same here:
Code Block swift
[default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
[default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.

xCode 12.1

Any updates how to solve it? Any workaround?
Hi,

I'm also having this problem after updating to xCode 12.1, could anyone find a solution for this?
I resolved the console messages by adding the new watchOS 7 App struct. The WKExtensionDelegate protocol conformance isn't required, but I added it for completeness. Move code from your extension delegate to your new App struct.


Code Block
import SwiftUI
@main
structMyWatchApp: App {
  @WKExtensionDelegateAdaptor(MyWatchAppDelegate.self) var myWatchAppDelegate
   
  @SceneBuilder var body: some Scene {
    WindowGroup {
      ContentView()
    }
  }
}
class myWatchAppDelegate: NSObject, WKExtensionDelegate {  
}

Hey guys, I had this same issue but referred to https://developer.apple.com/forums/thread/53659 , after which the Watch app works as expected. I still get the entry point error but it doesn't seem to affect anything.
the same error occurred.
what should I do?

I am also getting this with a brand new Independent watchOS App project with Xcode 12.3 and targeting watchOS 7.2

Code Block
2020-12-22 16:48:51.111294-0800 redlightgreenlight WatchKit Extension[66073:1532791] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
2020-12-22 16:48:51.111800-0800 redlightgreenlight WatchKit Extension[66073:1532791] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.

Hey, I'm having the same issue.

Does anyone have a solution to this?

2021-01-16 10:32:16.031695+0000 XXX WatchKit Extension[298:60997] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
2021-01-16 10:32:16.032378+0000 XXX WatchKit Extension[298:60997] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.
I also get this error. I'm on XCode 12.2 (I can't update it, because I need 20+ gb free space to do that for some reason, which is near impossible with my 128gb MBP). I can't think of any code change I've made which would've caused this. As a sanity check, I've commented out almost all of the UI (I was solely doing UI work when this started happening), and it's still happening.

They could at least get the spelling in the error message correct.
Code Block
Swift entry point addres could not be determined.

It really shows the level of attention they're giving to Watch development. You'd expect better from a $2T company
I resolved this issue by setting the watchOS deployment target to 6.0 and downloading and installing v6.2 of the simulator.

I'm not sure if the resolution was due to upgrading target, or resolving target/simulator watchOS miss-match (which for a while I had) or just because I upgraded/re-installed simulator.
@SpaceMan, whats the solution, I'm getting same issue
Xcode Log Error:

Warning: Error creating LLDB target at path '/Users/XXXXX/Library/Developer/Xcode/DerivedData/VM-ahksdstzldqcwielhvihoeabkyqy/Build/Products/Release-watchsimulator/KWatchOS2.app'- using an empty LLDB target which can cause slow memory reads from remote devices.
skipping /Applications/Xcode12.app/Contents/Developer/Platforms/WatchOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/watchOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim
2021-04-19 16:40:36.632492+0530 KWatchOS2 Extension[4857:50926] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
2021-04-19 16:40:36.633521+0530 KWatchOS2 Extension[4857:50926] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.


Xcode Running Error Details:

Error Launching 'KWatchOS2.app'
Domain: IDELaunchErrorDomain
Code: 16
Failure Reason: DTServiceHub Watch Control Channel init failure for: com.XXXX.WatchDemo.watchkitapp
  • -

DTServiceHub Watch Control Channel init failure for: com.XXXX.WatchDemo.watchkitapp
Domain: DVTDeviceErrorDomain
Code: -1
  • -

System Information

macOS Version 10.15.7 (Build 19H524)
Xcode 12.2 (17535) (Build 12B45b)

How can the accepted answer be the accepted answer? That's insane. Please tell us what fixed it.

Same problem here... please fix or explain how to fix.

2022-05-25 12:58:08.901951+0200 WatchAppPdTest WatchKit Extension[10107:4318585] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.
Apple Watch App - Invalid Swift entry point data
 
 
Q