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

Miroslav Kacera

08/09/2022, 1:47 PM
Hi, sorry if this was asked before but couldn't find anything useful so far. I'm starting with KMM and following official tutorial on kotlinlang page to create first cross-platform app. In general I got it working but there were some bumps along the road and one I can't resolve. I'm not able to run iOS build from Android Studio. It says
"Selected scheme "iosApp" does not support "iphonesimulator".
There is a ticket for the exact same issue but it's resolved as answered with link to SO solution which is not working in general. Some people say it worked for them some it didn't. I'm using apple silicon which I suspect is responsible for most of the issues while following the tutorial.
kdoctor
doesn't highlight anything specific to Android Studio there is only one failure related to
cocoapods-generate
which shouldn't be a problem and is most probably because brew install location on apple silicone. Anybody encountered this or have an ideas how to solve this? Btw running the app from xcode works so it's just the tooling (AS plugin?)
p

Pamela Hill

08/10/2022, 9:57 AM
Let me know what the result is, as cocoapods-generate is important for the running of the iOS app part. I'll try to assist
m

Miroslav Kacera

08/11/2022, 8:29 AM
Hi Pamela, thanks for the help. Unfortunately that didn't resolved the problem. I've managed to fix
cocoapods
issue (some ruby version mismatch, while detecting gems but otherwise working even before) and now I indeed have no failures for
kdoctor
. But as I have suspected this had no effect on the Android Studio plugin issue mensioned in the post. 😔
m

miqbaldc

08/26/2022, 1:49 PM
with this
kdoctor
now success (no error)
s

Sebastian Sellmair [JB]

09/05/2022, 4:08 PM
cc @Konstantin Tskhovrebov can you maybe quickly help us here?
k

Konstantin Tskhovrebov

09/05/2022, 4:20 PM
Let’s try to figure out . First of all, what is your current versions os Android Studio and Kotlin plugin inside? And check the run configuration with new generated project. Does it work now?
m

Miroslav Kacera

09/06/2022, 8:56 AM
Hi, here is all the relevant version info. I've tried to delete old project and create it anew. Unfortunately same result. As mentioned, running from XCode works.
Copy code
Android Studio Chipmunk | 2021.2.1 Patch 2
 Build #AI-212.5712.43.2112.8815526, built on July 10, 2022
 Runtime version: 11.0.12+0-b1504.28-7817840 aarch64
 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
 macOS 12.5.1
 GC: G1 Young Generation, G1 Old Generation
 Memory: 10240M
 Cores: 10
 Registry: external.system.auto.import.disabled=true
 Non-Bundled Plugins: Key Promoter X (2021.3), detekt (1.21.0), com.intellij.marketplace (212.5712.51), org.jetbrains.kotlin (212-1.7.10-release-333-AS5457.46), idea.plugin.protoeditor (212.5080.8), com.jetbrains.kmm (0.3.3(212-1.7.0-RC-release-217-IJ)-104)
Copy code
Model Name:    MacBook Pro
 Model Identifier:    MacBookPro18,2
 Chip:    Apple M1 Max
 Total Number of Cores:    10 (8 performance and 2 efficiency)
 Memory:    32 GB
 System Firmware Version:    7459.141.1
 OS Loader Version:    7459.141.1
 Activation Lock Status:    Disabled
Copy code
~ % kdoctor
[v] System
  OS: macOS (12.5.1)
  CPU: Apple M1 Max
[v] Java
  Java (openjdk version “11.0.12” 2021-07-20)
  Location: /Users/kaceram/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/jre/Contents/Home/bin/java

  JAVA_HOME=/Users/kaceram/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/jre/Contents/Home

  * Note that, by default, Xcode uses Java environment returned by /usr/libexec/java_home:
   /Users/kaceram/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8815526/Android <http://Studio.app/Contents/jre/Contents/Home|Studio.app/Contents/jre/Contents/Home>
   It does not match current JAVA_HOME environment variable:
   /Users/kaceram/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/jre/Contents/Home
     Set JAVA_HOME in XCode -> Preferences -> Locations -> Custom Paths to
     /Users/kaceram/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/jre/Contents/Home

  * Note that, by default, Android Studio uses bundled JDK for Gradle tasks execution.
     Gradle JDK can be configured in Android Studio Preferences under Build, Execution, Deployment -> Build Tools -> Gradle section

[v] Android Studio
  Android Studio (2021.2)
  Location: /Users/kaceram/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/212.5712.43.2112.8815526/Android <http://Studio.app|Studio.app>
  Bundled Java: openjdk 11.0.12 2021-07-20
  Kotlin Plugin: 212-1.7.10-release-333-AS5457.46
  Kotlin Multiplatform Mobile Plugin: 0.3.3(212-1.7.0-RC-release-217-IJ)-104

[v] Xcode
  Xcode (13.4.1)
  Location: /Applications/Xcode.app

[v] Cocoapods
  ruby (ruby 2.7.6p219 (2022-04-12 revision c9c2245c0a) [arm64-darwin21])

  ruby gems (3.3.11)

  cocoapods (1.11.3)

  cocoapods-generate (2.2.2)

Your system is ready for Kotlin Multiplatform Mobile Development!
Fixed! I have no longer this issue with
0.3.4
version of the plugin. Thank you! 👌
8 Views