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

bsimmons

09/21/2020, 1:57 PM
So my code auto-complete and highlighting isn't working for
iosMain
. So far I've managed by just guessing names and such, but I'm wondering how do I actually get this working on a Mac? Any ideas?
a

Artyom Degtyarev [JB]

09/21/2020, 2:01 PM
Hello, @bsimmons! Are you facing it with Kotlin 1.4? If so, can you please share the project’s source sets hierarchy?
b

bsimmons

09/21/2020, 2:04 PM
I am still running 1.3.70. Here's what my source sets look like.
a

Artyom Degtyarev [JB]

09/21/2020, 2:08 PM
Ah. Unfortunately, those functions won’t work well for 1.3.70. Hierarchical project structure was introduced in the 1.4 milestone(see here). Just for the research purposes, is there a specific reason you’re staying on this version?
b

bsimmons

09/21/2020, 2:20 PM
Ok, that's too bad. I'll have to get everyone to update someday. Some apps we've pushed are still running 1.3 and I've been backporting some fixes.
j

Joaquim

09/22/2020, 3:15 AM
this happened to me the other day, the code ran fine but the IDE didn’t recognize the imports (this was on 1.4.0 btw) - I fixed it by changing from
Copy code
kotlin {
   ios()
   ...
}
to
Copy code
kotlin {
   iosX64("ios")
   ...
}
and suddenly the IDE found all the
platform.*
imports fine. I suspect there’s an issue with multi architecture targets.
2 Views