So my code auto-complete and highlighting isn't wo...
# multiplatform
b
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
Hello, @bsimmons! Are you facing it with Kotlin 1.4? If so, can you please share the project’s source sets hierarchy?
b
I am still running 1.3.70. Here's what my source sets look like.
a
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
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
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.