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

darkmoon_uk

08/15/2019, 10:31 PM
Surprised that #multiplatform fans aren't more affected by this related family of issues in IntelliJ/Android Studio Gradle Integration: https://youtrack.jetbrains.com/issue/KT-30390 https://youtrack.jetbrains.com/issue/KT-32814 https://youtrack.jetbrains.com/issue/KT-30912 ...the IDE 'breaks' if you depend on a Multiplatform project from a JVM project, when there is an Android target in the dependency. If this is your use-case now or in the future; consider showing these issues some voting ❤️.
✔️ 1
1
👍 1
@mbonnin ...yeah. This one's really frustrating my efforts right now. The Gradle setup & build is working great but the IDE is letting the side down. Trying to find out where exactly the sync message "WARNING: Ignoring dependency of module '<A>' on module '<B>. Java modules cannot depend on Android modules" is coming from, to get a handle on it. String is not found in the IntelliJ CE repo: https://github.com/JetBrains/intellij-community
l

louiscad

08/15/2019, 10:58 PM
It's probably in the Android IDEA plugin found in the Android Studio repository, that is then added to IntelliJ.
As expected, for Java Modules, there's a blunt check to see if a candidate dependency module has an Android 'Facet' at all. If it does, it's not incorporated into the IDE's model.
Practical first step: observe the behaviour if this check is removed? Looks non-trivial/impossible to perform equivalent check at a finer task/dependency level, at Gradle Sync time. There may already be 'safety' checks that would fail at those levels at task/dependency level at compile time. If so, this would make the current Module check something of a 'UX optimisation' which is just not valid when there is also a Multiplatform 'facet' present.
l

louiscad

08/16/2019, 12:13 AM
I think you should add these 2 comments in the issue you just commented on with the link only, might be helpful to testers like @Liliia
🙏 1
👍 2
1
m

mbonnin

08/16/2019, 7:17 AM
I "think" I have the opposite problem ? My java modules are not recognized by the IDE unless I apply the android plugin to them
Now that all my mpp modules also target android, intelliJ is working fine again (https://github.com/HearthSim/Arcane-Tracker/commit/2d652d678bdfd26e8eca779f9fd697e178c18ff6)
That's a workaround obviously
s

Sebastian Sellmair [JB]

10/01/2020, 12:42 PM
Can somebody confirm that this happens to you guys and potentially upvote if so? https://youtrack.jetbrains.com/issue/KT-42381
Also: If someone is experiencing this issue: 📣 youtrack HMPP: Bad IDEA dependencies for JVM and Android intermediate source set
👍 2
I am currently working on this story! Does somebody know a larger project targeting JVM&Android that I can use to manually test my fixes? (Currently trying to verify those MPP: Bad IDEA dependencies for Android Target depending on project with JVM target; leaking foreign `commonTest` into `androidTest` Android lib dependencies on a multiplatform module with both Android and JVM targets are incorrectly resolved )
l

louiscad

10/16/2020, 3:01 PM
This project might do: https://github.com/russhwolf/multiplatform-settings I can also try dev versions you specify on a private project with about 60 modules that shares code between JVM and Android, and give you feedback and logs.
s

Sebastian Sellmair [JB]

10/16/2020, 3:22 PM
The project you mentioned would be perfect 😮 However, it will not be that easy, since you would need to use a dev version of kotlin and IDE nightly builds. I am not sure if I am allowed to send nightly IntelliJ builds 😞 Will find that out ☺️
l

louiscad

10/16/2020, 3:54 PM
@Sebastian Sellmair [JB] My project requires AGP 4.1+ and I'm currently using Android Studio 4.2 Canary. Would it work with IntelliJ nightly builds when it comes to AGP compatibility? Also, does it mean the fixes in Android Studio will come quite long after they land in IntelliJ IDEA?
s

Sebastian Sellmair [JB]

10/16/2020, 4:28 PM
😢 No support for AGP 4.1+ in intellij right now 😞 We are currently working on merging latest changes there. Regarding the workflow: Usually: yes. The roundtrip between intellij and AS is quite long. This is the reason why we have seen many issues being fixed in only one platform and we had to wait for a long time to see the fix appear in the other. However, I am pretty committed on changing this. After we are pretty confident with those changes, we will send a patch ad-hoc to the Studio team for MPP related issues.
l

louiscad

10/16/2020, 8:30 PM
Maybe I could make a (copied) version of the project that is downgraded to AGP 4.0.2 just to test the IDE experience with IDEA nightlies? I think I can stand changing a few things if needed, I had to change things in only one module's
build.gradle.kts
when I moved to AGP 4.1 amid API changes and it being done with Kotlin instead of Java, plus I think I could even find the commit back if it's not backwards compatible. So, if you can get me using IDEA nightlies, then I can do the tests!
2 Views