Hello! I'm working on adding composables to SwiftU...
# compose-ios
a
Hello! I'm working on adding composables to SwiftUI application. I have working project I can run on a device, but as soon as I validate it for distribution using Xcode I get errors "the binary is invalid" and "incorrect platform (arm64)"; attached is screenshot for details. I'm using cocoapods. I had to uncheck target membership of
.framework
to archive the project in Xcode. I use Compose 1.4.1. I have removed
cocoapods.framework.isStatic
property, which defaults to
false
. Perhaps somebody have already solved this issue? Am I missing some information on how to distribute Compose apps for iOS?
👍 1
t
For static frameworks, in the Frameworks, Libraries and Embedded Content the Embed option should be set to 'Do Not Embed'.
a
Thanks for your reply Tyler. This is what I have when building from Gradle, but to compile from Xcode I need to remove this entry. Also, I am not using static framework since I have removed
isStatic
property.
t
ah, i was assuming you were using compose in ios, which requires the framework to be static.
a
I am using Compose in iOS, so I'm surprised to hear it requires static framework
t
unless they changed something in the latest 1.5.0-beta2, yeah it requires static frameworks, which are then pulled into Xcode differently.
though i am not using cocoapods, but the XCFramework generation
a
That's really interesting since I'm not using static framework with Compose version 1.4.1
Do you have some link to documentation about this requirement?
t
and it has been mentioned in this channel a number of times
a
I know it's static there, but it doesn't imply the requirement I suppose. I'm happy to provide details on my project if you're interested, but I still need a solution to my original issue with failing distribution
t
it may be related is what i am suggesting.
☝️ 1
d
You may try to use Compose 1.5.0-beta02
If you want to try Compose 1.5.0-beta02 you should do the following with your project: • Update Compose version to
1.5.0-beta02
, Kotlin version to
1.9.0
• Remove line with resources https://github.com/JetBrains/compose-multiplatform-ios-android-template/blob/c20faa099552dac7bcc242c72fe49e1f260177e9/shared/build.gradle.kts#L25 • And run command
./gradlew podInstall
once
a
I switched to using regular framework instead of cocoapods and it magically worked. I'm going to try 1.5.0-beta02 as soon as moko-resources support Kotlin 1.9.0. https://github.com/icerockdev/moko-resources/pull/542 Thanks for your support @Dima Avdeev and @tylerwilson!
👍 1