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

Juarez

02/21/2024, 9:43 PM
Should android studio and the "kotlin multiplataform mobile" plugin work allright with xcode 15.2? The compatibility list indicates xcode 15.0. Could this difference on the minor verson cause android studio to not recognize ios simulators?
a

Alejandro Rios

02/21/2024, 9:51 PM
Do you have the latest version of the KMM plugin?, what template did you use for your project?
I do have Xcode 15.2 and a pet KMP project
I added desktop and web, but the other 2 should appear on your IDE
j

Juarez

02/21/2024, 9:52 PM
I have version "Kotlin Multiplataform Mobile" v 0.8.2(231)-25
a

Alejandro Rios

02/21/2024, 9:53 PM
I have the same, what happens when you run
kdoctor
in your terminal?
j

Juarez

02/21/2024, 9:54 PM
the template for the project was from the KMM wizard, which I found linked on tutorial
all green with kdorctor
Conclusion: ✓ Your operation system is ready for Kotlin Multiplatform Mobile Development!
This wizard: Kotlin Multiplatform Wizard Also, I clicked to share both logic and UI
one details is that the iosApp configuration did not came out of the box from the wizard. I had to click to configure it.
a

Alejandro Rios

02/21/2024, 10:00 PM
Ok, lets try this:
j

Juarez

02/21/2024, 10:00 PM
is there a way for me to "build kotlin to ios", such that I can open the project "iosApp" on xcode and run the simulator from there?
💯 1
yes black 1
a

Alejandro Rios

02/21/2024, 10:00 PM
click on the
Edit Configurations
, on the new window, click on the + sign
Do you see this option?
j

Juarez

02/21/2024, 10:01 PM
I tried this, but on this screen I get an empty list of "execution target"
Do you see this option?
Yes I see it
a

Alejandro Rios

02/21/2024, 10:03 PM
oh, ok, you have the choice to run the iOS app, what you don't have is the simulator to run it
Screenshot 2024-02-21 at 17.03.26.png
j

Juarez

02/21/2024, 10:03 PM
yes! I am missing the simulator
how did you get that iPhone 15 to show up there?
I noticed this error when trying again:
Error: Please specify Xcode project location
a

Alejandro Rios

02/21/2024, 10:06 PM
Open Xcode -> go to Settings -> Platforms -> click on the + sign -> select iOS simulator and select iOS 17
j

Juarez

02/21/2024, 10:08 PM
i have quite a few of these
also, the simulator runs ok from within xcode
i think i'm hitting a similar problem
so...it seems I should be able to run the KMP project from within xcode
a

Alejandro Rios

02/21/2024, 10:12 PM
Have you tried running the project from Xcode?
j

Juarez

02/21/2024, 10:13 PM
i get "no such module ComposeApp"
hm i guess i need to export the KMP project inside the iosApp dir somehow
a

Alejandro Rios

02/21/2024, 10:14 PM
I have no idea on that case
You could try using this template to see if you have the same error: https://terrakok.github.io/Compose-Multiplatform-Wizard/
j

Juarez

02/21/2024, 10:21 PM
will do!
thanks!
that is one fancy template
any idea where this comes from?
a

Alejandro Rios

02/21/2024, 10:29 PM
It's from one of the members of the Jetbrains team, you can select the libraries you want to include in your project
You can use either one
j

Juarez

02/21/2024, 10:39 PM
well it did not work out of the box
i got errors when building
jbr/Contents/Home//bin/java: cannot execute: No such file or directory
something weird with the location of java maybe
looks fixable
hm even if the build is broken, the run configuration at least identifies the simulators
kkkkkkkkkkkk
now it shows on my project as well
one thing I did in the mean while was to run "gradelw assemble" from the command line
👍 1
omg the simulator is working from android studio
and now the template from the jetbrain guy is also working. I had to fix something w/ my JAVA_HOME var.
well thanks @Alejandro Rios! Your support had me not give up on this! That was awesome
👍 1
30 Views