Pablichjenkov
05/31/2024, 1:08 PMMarc
05/31/2024, 1:24 PMPablichjenkov
05/31/2024, 2:27 PMPablichjenkov
05/31/2024, 2:29 PMMarc
05/31/2024, 2:34 PMPablichjenkov
05/31/2024, 2:48 PMThat would be ideal shipping one .klib with all swift inside!
The project I linked uses the solution I described above, the double distribution technique. Is kinda tedious for clients because the double import KMP and Swift Package and the umbrella name restriction but I think is all we can do right now 🤷♂️Marc
05/31/2024, 2:57 PMMacaoFirebaseAuthKmpWrapper
definition come from here? Is it imported with the ComposeApp
import? I am not very familiar with how SPM works, so I don't really understand how the Kotlin interface is imported especially since there doesn't seem to be a dependency on anything but the Firebase SDK in the Package.swift file.Pablichjenkov
05/31/2024, 3:25 PMComposeApp
will provide(using export
) the Kotlin abstractions needed in the iOS side. It is imported via direct .framework
. Open the project.pbxproj
file and look the property Framework_search_path, it should point to composeApp/build dir where the KMP .framework will be generated after embedAndSignAppleFrameworkForXcode
gradle task finishes. So my project is basically Manual integration but you can opt for local SPM integration
using binaryTarget("path-to-your-xcframework")
. I just opted for manual integration because compilation of a .framework
is faster than .xcframework
. And SPM only supports xcframework.
On the swift side, in Xcode, you will import your Swift Package which will bring automatically its depending packages. You can import a package directly in Xcode, or using a Package.swift declaration as in my project. There are many videos and tutorials on how to integrate SPM in an iOS project.
Once Xcode has both parts needed compilation will be successful because it will be able to compile your implementation package against the KMP interfaces you provided