SimpleWatchConnectivity sample - TransferFile fails

When launching the SimpleWatchConnectivity sample in a simulator (iOS 18.2 + watchOS 11.2), almost all the functionality works, but TransferFile does not work. The error is the following:

-[WCFileStorage persistOutgoingFileTransfer:] error serializing file transfer <WCSessionFileTransfer: ...> due to Error Domain=NSCocoaErrorDomain Code=4866 "Caught exception during archival: This object may only be encoded by an NSXPCCoder."

How can it be fixed or worked around?

Thanks for the post. I’m sorry you are facing an issue with the TransferFile functionality in the SimpleWatchConnectivity sample.

Are you referring to the sample posted on the Transferring Data With Watch Connectivity page?

https://docs-assets.developer.apple.com/published/50d45f3a1b60/TransferringDataWithWatchConnectivity.zip

If the transfer file component is causing an error or exception in the new Xcode, kindly consider filing a bug report. Prior to filing the report, please ensure that you have the most recent versions of Xcode, iOS, and watchOS installed.

Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Albert Pascual
  Worldwide Developer Relations.

SimpleWatchConnectivity sample - TransferFile fails
 
 
Q