Unable to add apple device in Android studio
Asked Answered
M

4

6

I want to try out the Kotlin Multiplatform Mobile (KMM) in Android studio. I have installed the Plugin and when I try to add configuration for IOS, nothing shows up. I just have an IOS option but nothing shows up when I click on it. The android device is already set up, so I was able to run it in Android.

enter image description here

Madelene answered 29/9, 2020 at 4:28 Comment(7)
Are you running AS on macOS. Otherwise you cannot use simulators. If you create the project with KMM plugin it's weired that you don't have the run configuration for iOS already set up, but you can try to click on the + button on the upper-left corner.Dennie
I'm running AS on Windows 10.... will apple ever stop with this BS of using only mac for development?Madelene
I guess this would come in remote future [-; But who knows... maybe Apple could leave us speechless with an unexpected move XDDennie
I post our findings as an answer for future readers.Dennie
even on my macbook same issue exists.Necktie
I am not able to start a project in AS in windows. How were you able to start the project?Thumbnail
@Parth maybe they've made some changes recently. This was long back and kmm was in beta.. idk if it's still in beta but changes keep happening during beta releases. so if you're serious about stable multi platform, I'd recommend flutter for now.Madelene
D
4

I guess you are not running Android Studio on macOS. You must have macOS to compile through XCode and use Apple Simulators.

If you are running AS on macOS and you created the project with KMM plugin it's weird that you don't have the run configuration for iOS already set up, but you can try to click on the + button on the upper-left corner. Remember that you must have XCode (and Simulators) and command line tools installed on your machine.

If you are running AS on an OS different from macOS you can only compile the non native (not macOS or iOS) part of the library.

Dennie answered 1/10, 2020 at 6:58 Comment(2)
I use windows 10. I get it. I am poor and I can't afford apple products. nvmMadelene
I am using Apple MAcbook and still have the same issue. Cannot See any configuration. The AS kind of hangs when I click on IOS Application in Add Configurations dropdown menu.Necktie
P
1

Had the same issue. What fixed it it for me was installing Xcode command line tools with xcode-select --install. If that doesn't work, generally check the integrity of your Xcode setup.

Pence answered 25/3, 2021 at 10:38 Comment(2)
are you using windows?Madelene
No, there is no Xcode on windows (at least not without considerable workarounds)Buttress
F
0

You need following to run your KMP app from android studio on ios device

  1. Mac
  2. Android Studio IDE
  3. Install kdoctor tool
  4. Xcode IDE
  5. Cocapods
  6. Install Kotlin Multiplatform Mobile (plugin)

After all these steps do the rest as follow

  1. Go to Edit Configuration.
  2. Click on (+) Icon on top Left to Add New Configuration.
  3. You will find iOS Application configuration in the list choose it.
  4. Then you need to fill the following details.

iosApp Configuration

As you can see for 1st field you need to choose iosApp.xcodeproj and you will find it under your created project directory open it there you will find iosApp folder inside it you can find iosApp.xcodeproj file choose it in the 1st field and for rest of field select as show in screenshot. Apply -> OK

There you go you will have iosApp configuration.

Former answered 22/5 at 8:29 Comment(0)
C
0

I encountered this error after I had updated my macOS to the latest version (Sequoia 15.0.1 (24A348) as of this date)

What worked for me:

  1. Update android studio to the latest version (Ladybug | 2024.2.1 Patch 1 as of this date)
  2. Update xcode to the latest version (Version 16.0 (16A242d) as of this date)
  3. Update kdoctor (not significant)

Hope this helps someone

Coastland answered 19/10 at 20:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.