# Kotlin/Native iOS Development on Windows

**URL:** <https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699>\
**Category:** Native\
**Created:** [May 15, 2020, 8:49pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699 "2020-05-15T20:49:25Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![tradeJmark](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tradeJmark](https://discuss.kotlinlang.org/u/tradeJmark)\
**Post date:** [May 15, 2020, 8:49pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/1 "2020-05-15T20:49:25Z")

</div>

I know that you can only build native iOS modules on macOS. That’s unfortunate (and yeah, Apple’s fault, not Kotlin’s), but it’s okay with me as long as I can just do the development on my Windows machine.  
But, can you?  
My development environment is IntelliJ IDEA. I’ve set up Mobile Shared Library (one of the options under Kotlin in New Project). Everything looks fine, but whenever I try to use Objective-C stdlib stuff in the iOS module (e.g. `import platform.Foundation`…), I get “Unresolved reference: platform”. Is this just expected on Windows? Can I not even do the development on a windows machine? Or, is it some problem with my Gradle setup, or my IDEA setup? Does anyone know? Has anyone successfully developed for Kotlin/Native targeting iOS on Windows, and could give me some pointers?

---

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [May 15, 2020, 9:27pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/2 "2020-05-15T21:27:19Z")

</div>

I encountered this bug as well. Going to 1.4-M1 solved.

---

<div class="post-metadata">

**Author:** ![tradeJmark](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tradeJmark](https://discuss.kotlinlang.org/u/tradeJmark)\
**Post date:** [May 18, 2020, 6:12pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/3 "2020-05-18T18:12:28Z")

</div>

Thanks for the suggestion! I tried it, but I don’t really see any changes. If you don’t mind and you have a minute, could you show me what your build.gradle file looks like? Might help me see what I’m doing wrong.

---

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [May 18, 2020, 7:28pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/4 "2020-05-18T19:28:09Z")

</div>

Have a look at my [GitHub](https://github.com/lamba92), in particular, firebase-multiplatform and KGraph.

firebase-multiplatform has a really ocmpelx build script tho and uses the `buildSrc`.

---

<div class="post-metadata">

**Author:** ![tradeJmark](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tradeJmark](https://discuss.kotlinlang.org/u/tradeJmark)\
**Post date:** [May 19, 2020, 5:26pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/5 "2020-05-19T17:26:13Z")

</div>

Yeah, I have no idea what’s going wrong. I updated my Kotlin IntelliJ plugin to use the 1.4 EAP channel, then I cloned your firebase-multiplatform repo and opened it up in IntelliJ, I’m still getting the issue I initially described. Maybe this just isn’t ready for use in my situation yet, I’m not sure it’s really worth it to invest my time much more into it.

---

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [May 20, 2020, 7:21pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/6 "2020-05-20T19:21:00Z")

</div>

K/N is still in early phase. You have to take that into account, bugs will happen (but I must say I encountered very very few lately) and APIs surfaces will change. Also performances are not that great as well yet, though I’m confident that when it will be out of beta the K/N team will quickly iterate for performance 🙂

My personal opinion is that while K/N is great because of Kotlin itself (duh!), the killer feature is the tooling (GRADLE FTW!). It definitely worth investing some time into understanding K/N and toying with it.  
Choosing it as you primary technology for you app is up to you! Many big companies are already using K/N and they are pretty happy, while others are not!

---

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [May 20, 2020, 7:22pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/7 "2020-05-20T19:22:25Z")

</div>

You may try cloning KGraph and check if it build! Try the `dev` branch as well, even tho it may not compile for other reasons 😛

---

<div class="post-metadata">

**Author:** ![lamba92](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/lamba92/32/5089_2.png) [@lamba92](https://discuss.kotlinlang.org/u/lamba92)\
**Post date:** [May 20, 2020, 7:58pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/8 "2020-05-20T19:58:14Z")

</div>

Oh wait I misread the title! That is not bug! Bindings for Apple libraries are built by the K/N plugin! Which means that they cannot be built on Windows!

In my examples I wrote KGraph using solely `common` sources, while firebase-multiplatform has the Apple side built under macOS!

---

<div class="post-metadata">

**Author:** ![joffrey.bion](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/joffrey.bion/32/5084_2.png) [@joffrey.bion](https://discuss.kotlinlang.org/u/joffrey.bion)\
**Post date:** [August 17, 2021, 12:18am UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/9 "2021-08-17T00:18:08Z")

</div>

Isn’t there a way to access the Kotlin bindings for Apple libraries even on a Windows system?

My goal is to write the code in my IDE on Windows (with proper completion) but not necessarily build any executable or run any code (that will be done on macOS on the CI). I just would like code completion on Windows, so that would technically just require the Kotlin bindings without the actual Apple runtime.

---

<div class="post-metadata">

**Author:** ![tradeJmark](https://avatars.discourse-cdn.com/v4/letter/t/ba9def/32.png) [@tradeJmark](https://discuss.kotlinlang.org/u/tradeJmark)\
**Post date:** [August 17, 2021, 12:34am UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/10 "2021-08-17T00:34:48Z")

</div>

Yeah, that’s what I was hoping for, although I never did find any indication that it was possible.

---

<div class="post-metadata">

**Author:** ![joffrey.bion](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/joffrey.bion/32/5084_2.png) [@joffrey.bion](https://discuss.kotlinlang.org/u/joffrey.bion)\
**Post date:** [August 17, 2021, 1:46pm UTC](https://discuss.kotlinlang.org/t/kotlin-native-ios-development-on-windows/17699/11 "2021-08-17T13:46:23Z")

</div>

I just found out that it is possible, thanks to @LouisCAD 's Gradle plugin called [CompleteKotlin](https://github.com/LouisCAD/CompleteKotlin).

Here is the related Slack discussion:

> **[Slack is your digital HQ](https://kotlinlang.slack.com/?redir=%2Farchives%2FC3PQML5NU%2Fp1623341031492000)**
>
> Slack is a new way to communicate with your team. It’s faster, better organized, and more secure than email.
