Replies: 1 comment 2 replies
-
@KaiOelfke I'm going to convert this to a discussion till it can be reproduced without changing the library's package file. Currently it sounds like this has more to do with Tuist projects that use Sharing as a dynamic library. Perhaps the Tuist community has a solution? If you are able to reproduce this in a vanilla SPM project, please share it with us and we can determined if it's an actual bug with the library. It's possible module aliases could also work around the issue. Let us know if you explore that and have any luck! |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When using swift-sharing as dynamic library on iOS 16 simulators it crashes on launch:
There's a name conflict with a private Apple framework also called
Sharing.framework
.While I discovered this issue initially within a project using Tuist it can also be reproduced without using Tuist. In order to reproduce it a single change has to be done in the swift-sharing package manifest. This forces Xcode / SPM to integrate Sharing as dynamic library.
main...KaiOelfke:swift-sharing:main
On the main branch of swift-sharing nothing is specified for type, which doesn't mean it'll be always a static framework.
Then you only need some simple sample project using swift-sharing and run on an iOS 16 simulator. I can't test iOS 16 devices as I don't have one. iOS 17 / 18 seem to be not affected. My guess would be that the framework doesn't exist anymore or newer versions of dyld handle this name collision somehow. But I don't really know.
I've solved this with the steps described in https://community.tuist.dev/t/sharing-framework-symbol-not-found/279/9. For vanilla SPM or Xcode projects this can probably also be fixed by using moduleAlias in SPM or alternatively in other swift flags
-module-alias Sharing=PFSharing
. ThePRODUCT_NAME
build setting maybe also has to be changed.I'm filing this issue to document it and I don't need another solution. I guess renaming the framework is not easy as I remember the issues with
XCTestDynamicOverlay
and probably also not worth it for only iOS 16.Checklist
main
branch of this package.Expected behavior
The app should launch and run.
Actual behavior
The app crashes on launch.
Reproducing project
ShareSample.zip
Sharing version information
KaiOelfke@0251bfe
Destination operating system
iOS 16
Xcode version information
Version 16.1 (16B40)
Swift Compiler version information
Beta Was this translation helpful? Give feedback.
All reactions