apple/swift-protobuf

How to properly add Swift Protobuf to the project as XCFramework?

pwittchen opened this issue · 2 comments

Hi,

I read discussion in the issue #1101 which is related to this issue, but it's still unresolved.
I'm struggling to add Swift Protobuf dependency as XCFramework to the project. I'm providing custom library to the clients, which uses Swift Protobuf under the hood, but not all clients are allowed to use Cocoa Pods or Swift PM due to some corporate/security restrictions. That's why I want to provide Swift Protobuf as XCFramework besides my library.

I crated Swift Protobuf as XCFramework with Carthage and client got the following errors:

Symbol not found: _$s13SwiftProtobuf19_ProtoNameProvidingP17_protobuf_nameMapAA01_dH0VvgZTq

  Referenced from: /Users/.../Library/Developer/Xcode/DerivedData/app-fjxtxghupzrzaqgmblomcfbryxpp/Build/Products/UAT-iphonesimulator/iOS_SDK.framework/iOS_SDK

  Expected in: /Users/.../Library/Developer/Xcode/DerivedData/app-fjxtxghupzrzaqgmblomcfbryxpp/Build/Products/UAT-iphonesimulator/SwiftProtobuf.framework/SwiftProtobuf

Can you please give me some suggestions, how can I properly create Swift Protobuf as XCFramework, so I can provide it to the clients and they won't get any errors?

Regards,
Piotr

Swift Protobuf doesn't provide a stable ABI, so generally speaking you cannot offer it to clients in the form of an XCFramework. You would need to conceal your use of Swift Protobuf, importing it as @_implementationOnly.

As this is fundamentally the same issue as #1101, I'm going to close this issue to centralise conversation there.