https://kotlinlang.org logo
e

Etienne

11/03/2021, 4:15 PM
When I setup a multiplatform module with an android component, I find the intelli-sense for JS breaks. (And I've run into some issues combining it with JVM things as well).
1
m

mbonnin

11/03/2021, 4:17 PM
I kinda gave up on IDE autocomplete + MPP + AGP. Filed this some time ago. Maybe things will get better with HMPP but the last comment on this issue isn't very encouraging
When I need AGP, I put logic in the Gradle files to ignore it during sync like:
Copy code
if (System.getProperty("idea.sync.active") == null) {
   // Apply AGP here so that the IDE doesn't see it
e

Etienne

11/03/2021, 4:18 PM
right. I got that impression too. I'm trying to find ways to sidestep issues, because broken intellisense makes for a painful dev experience.
oh that's one good trick to know..
m

mbonnin

11/03/2021, 4:18 PM
It's not great but it kinda does the job
e

Etienne

11/03/2021, 4:19 PM
right now I'm trying to see if I can somewhat mitigate the issue by splitting things up in modules and merging them back together.. not sure it'll work
m

mbonnin

11/03/2021, 4:19 PM
I also have this issue bookmarked: https://youtrack.jetbrains.com/issue/KTIJ-14471
AFAIK, splitting things in modules doesn't help much... Maybe with included builds that could work...
e

Etienne

11/03/2021, 4:25 PM
well.. I found that if AGP is not included in the multiplatform module, intellisense starts working, at least for a JS subcomponent..
👀 1
now I'm checking if 'actual' classes can be implemented in separate modules.. not sure that's possible
m

mbonnin

11/03/2021, 4:27 PM
I think it's coming but not possible yet
It was mentioned during one of the Kotlin event videos last week
e

Etienne

11/03/2021, 4:27 PM
right.. well, if I can at least limit the damage to "actual" JS implementations, it's a bit better..
what looks promising is having a
jsLib
module, having my
shared
js depend on it. With some judicious use of
typealias
, should end up with a
shared
module that mostly has
common
code.
👀 1
I really find it's the
android
gradle plugin messing things up. So, I'll also be trying a library module, with `jvm`/`js`/`native` configurations.
need to test to be sure it'll be something iOS/Android will be able to use, but that also looks promising.
2 possible workarounds. I'll let you know how well it went 🙂
🙏 1
m

mbonnin

11/03/2021, 7:38 PM
Nice!!!
4 Views