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 [***: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[***:xxxxxx] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data

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

2020-09-24 08:29:04.001368-0400 WatchApp Extension[***: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[***:xxxxxx] [WC] already in progress or activated

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

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

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

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

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

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

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

InterfaceController: your iphone is Reachable

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

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

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

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

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

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

Accepted Reply

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.

Replies

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.
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 *** WatchKit Extension[298:60997] [default] lookupMainFuncAddressInMachHeader:71: Invalid Swift entry point data
2021-01-16 10:32:16.032378+0000 *** WatchKit Extension[298:60997] [default] lookupMainFuncAddressInMachHeader:77: Swift entry point addres could not be determined.