Open acecilia opened 3 years ago
I found a few problems with this issue:
@acecilia Thanks for the report and sharing the thorough investigation.
We'll have to investigate if there are any alternatives for the FirebaseMLModelDownloader
binary distributions.
In the meantime, is it possible for you to integrate FirebaseMLModelDownloader
via a source distribution? CocoaPods, Swift Package Manager, or the source itself?
@paulb777 Thanks for the response! š I sadly cant integrate source and need a prebuilt binary, but I have a couple alternatives in mind:
SwiftProtobuf
xcframework and instead use yours (which is using the not supported BUILD_LIBRARY_FOR_DISTRIBUTION=YES
, but if it builds in my setup I think it is the easiest way)BUILD_LIBRARY_FOR_DISTRIBUTION=NO
@paulb777 there is another problem:
FirebaseMLModelDownloader
zip contains two xcframeworks: the FirebaseMLModelDownloader
and the SwiftProtobuf
oneCarthage
for integration, it is impossible to use your own SwiftProtobuf
, as in the final Carthage/Build
folder its undefined which of the xcframeworks will be used: will your own copy of SwiftProtobuf.xcframework
prevail, or will the Firebase SwiftProtobuf.xcframework
? Seems like Carthage
is not raising an error in this caseThis could be solved by distributing SwiftProtobuf.xcframework
using a dedicated zip
@acecilia Would you explain more about your workflow? My understanding is after installing with Carthage, there is still an integration step into an Xcode project in which you would choose which SwiftProtobuf.xcframework
to integrate.
@paulb777 Mmm Maybe I am missing something but: aren't both my SwiftProtobuf.xcframework
and Firebase SwiftProtobuf.xcframework
installed in the same path Carthage/Build/SwiftProtobuf.xcframework
?
So one would overwrite the other when Carthage installs them
I understand now. The other SwiftProtobuf
is also installed from Carthage. Thanks.
Hi @acecilia ,
I'm investigating this issue and I followed your post in apple/swift-protobuf#1101. I'm trying to reproduce the following error:
ā Undefined symbols for architecture x86_64
ā "method descriptor for SwiftProtobuf.Message.init() -> A", referenced from:
...
But haven't figured out how to do so given your sample project... do you have any suggestions?
Hey @ncooke3 š I just run make static_swift_protobuf
in Xcode 13.2.1 in an intel mac and can reproduce the issues, as explained. Could you give more details of your setup?
According to https://github.com/apple/swift-protobuf/issues/1101, there are solutions using @_implementationOnly import
and module aliasing with Swift 5.7
[REQUIRED] Step 1: Describe your environment
12.3
8.1.0
Carthage
FirebaseMLModelDownloader
[REQUIRED] Step 2: Describe the problem
FirebaseMLModelDownloader
I have other third parties in my app that depend on
SwiftProtobuf
(grpc), so when usingFirebaseMLModelDownloader
I am building my ownSwiftProtobuf
xcframework using Carthage, and that usesBUILD_LIBRARY_FOR_DISTRIBUTION=NO
. When doing that, multiple link errors show up (Undefined symbols). See the following issue for an extensive description of the problem: https://github.com/apple/swift-protobuf/issues/1101Steps to reproduce:
See: https://github.com/apple/swift-protobuf/issues/1101#issuecomment-855076010