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

elye

05/29/2021, 7:25 AM
Hi All, I’m exploring KMM as per https://kotlinlang.org/docs/mobile/integrate-in-existing-app.html#create-a-shared-module-for-cross-platform-code When I reach this step
./gradlew packForXcode
it complains…
Copy code
* What went wrong:
Task 'packForXcode' not found in root project 'Simple Login'.
I think the different is the tutorial iOS framework is
packForXocde
But when I use the latest KMM, it only has cocoapod….
How can I run the
./gradlew packForXcode
equivalent when using the Cocoapod iOS framework?
So just put it into your shared module's
build.gradle
e

elye

05/29/2021, 8:48 AM
Thanks @Arkadii Ivanov. I tried copy the Kotlin version and run it. I got the error
Copy code
FAILURE: Build failed with an exception.

* Where:
Build file '/kmm-integration-sample/shared/build.gradle.kts' line: 76

* What went wrong:
KotlinTarget with name 'iosX64' not found.
Any idea how to fix that?
a

Arkadii Ivanov

05/29/2021, 8:49 AM
Are you on macOS?
e

elye

05/29/2021, 9:19 AM
Yes, I’m on M1 macOS.
a

Arkadii Ivanov

05/29/2021, 10:07 AM
KMP on M1 has issues currently, I might be not 100% correct, but the iPhone simulator target for M1 is not currently supported https://youtrack.jetbrains.com/issue/KT-43667
However you should be able to build and run on a real device
e

elye

05/29/2021, 11:22 AM
iPhone simulator is working already. I just need the script to help setup the KMM onto the iOS side. Any insight how can I get that fix?
a

Arkadii Ivanov

05/29/2021, 11:30 AM
I think KMP does not support iPhone simulators on M1, there is just no such a gradle task yet
☝🏼 1