https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

Conrad Kramer

02/21/2022, 6:18 AM
This is super random, but it would be great to document
assembleAppleFrameworkForXcode
somewhere. I needed to use it to depend on a Kotlin framework from an iOS framework, because
embedAndSignAppleFrameworkForXcode
only works in app targets
s

Sam

02/21/2022, 2:50 PM
You probably want an XCFramework in that case. The assembleAppleFrameworkForXcode task just builds a framework that targets the current compilation environment (ios, ios-sim, ios-sim-arm64, etc). Building an XCFramework will allow you to build all of the target environments that you want.
🙌 1
c

Conrad Kramer

02/21/2022, 10:42 PM
This is not an iOS framework distributed on its own as an artifact (for all possible target environments), but rather only in the context of a single build. This is an extremely common pattern:
Copy code
iOS framework -> App, several extensions
If i want the iOS framework to depend on the Kotlin framework in any way, it needs to be compiled before the iOS framework is, and the App won’t start compiling until after the iOS framework is done if that makes sense
(the primary reason XCFrameworks exist is to allow multiple platforms to exist in the same file, and my iOS app is an iOS app and only supports a single platform)
t

Thomas

03/22/2022, 8:47 PM
@Conrad Kramer do you know of a way to get this working with kotlin 1.6.20-RC? It seems the
assembleAppleFrameworkForXcode
task no longer exists.
c

Conrad Kramer

03/22/2022, 10:00 PM
Correct!
I use this from my framework
Copy code
export FRAMEWORKS_FOLDER_PATH=PutAnythingHere
export EXPANDED_CODE_SIGN_IDENTITY="-"
./gradlew :shared:embedAndSignAppleFrameworkForXcode
t

Thomas

03/22/2022, 10:14 PM
Nice workaround, thanks for sharing!
3 Views