joreilly / PeopleInSpace

Kotlin Multiplatform sample with SwiftUI, Jetpack Compose, Compose for Wear, Compose for Desktop, and Compose for Web clients along with Ktor backend.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Stated swift package manager support is an overstatement

doozMen opened this issue · comments

I made a small experiment using the ./gradlew createSwiftPackage to generate a swift package of PeopleInSpace. This swift package I then tried to use as a local swift package. Only this does not work.

As I reference I have this project where I added a very basic setup https://github.com/doozMen/KMM-PeopleInSpace

If you agree may I suggest to not suggest that this project uses swift package manager as it is a good attempt but does not actually compile?

I could make some time to make this work if somebody could point me in a direction where to start ... I guess it might be better to wait until Kotlin Multiplatform supports swift package manager out of the box?

Are you trying this on an M1 device....if so you might be running in to ge-org/multiplatform-swiftpackage#31. I believe there are some forks of this that support M1 but I haven't had chance to investigate yet. The related changes I made at the time were done as part of exploration (described in https://johnoreilly.dev/posts/kotlinmultiplatform-swift-package/) to see what was possible.....default for project though is still not using that approach.

@joreilly thanks for mentioning but I think it is more then the M1 that lies to the problem. The xcframework produced also only has simulator architecture which would make impossible to build on any iOS device with it.

Hmm, could be issue with config I have currently there....though the library (https://github.com/ge-org/multiplatform-swiftpackage) states that it should support device and simulator. It's been some time since I tried this out and I could definitely have missed something. As mentioned, this is not default approach for the sample and was mostly added, as with a number of other parts of implementation, to just illustrate certain general capabilities (one that I know some people have been able setup to use successfully). Also, as mentioned, the library is unfortunately no longer being maintained it seems....I (or some contributor :) ) probably needs to track down a more up to date fork of this or perhaps re-work based on updated xcframework generation support that has been added as core capability since this.

  // all iOS targets (== device and simulator) with minimum version 13
  iOS { v("13") }

I've removed use of that plugin from code for now too avoid any confusion.... hopefully a more robust solution for this can be integrated in not too distant future.