Status Update
Comments
es...@google.com <es...@google.com>
ey...@gmail.com <ey...@gmail.com> #2
Thanks for the report! It looks like the lint check in ParcelChecker.java
has to be updated to account for the new behavior on sealed classes. Right now the checker just @Parcelize
annotations@Parcelize
.
je...@google.com <je...@google.com>
ey...@gmail.com <ey...@gmail.com> #3
You can see a repro for this in the included project. There are actually 2 issues:
-
Using Bumblebee / Chipmunk stable, open
routing/src/commonMain/kotlin/com/eygraber/galgal/routing/MainRouter.kt
and you can see that none of the imported classes are resolved (they're both from common code from an external dependency) -
Using Chipmunk stable, open
gradle/libs.versions.toml
and change the value ofandroid-plugin
to"7.2.0"
, sync, then openandroidApp/src/main/kotlin/com/eygraber/galgal/app/android/GalgalActivity.kt
and you can see that some of the material imports aren't resolved. Whenandroid-plugin
is set to"7.1.3"
this issue doesn't occur
In both cases, I can build and run the project in AS and from the command line.
ga...@google.com <ga...@google.com>
ga...@google.com <ga...@google.com> #4
Thank you for sharing the project!
The 2nd issue (missing material imports) is
I'm still looking into the 1st issue (MainRouter.kt
).
ey...@gmail.com <ey...@gmail.com> #5
I just tried with 7.4.0-alpha02 and indeed the missing imports is fixed; you literally just made my day!
Sebastian from the Kotlin Multiplatform team
Now the project in question here just has a single Target (android) defined. The Kotlin IDE plugin will detect that this is Android and that commonMain is effectively an Android source set as well (thats the intersection of all platforms). The plugin will expect Android being able to handle this source set and not run the import code. The expectation is that Android will also include this source set in its Project <-> IJ module representation. Now AS changed its internal representation and the expectation of the Kotlin IDE plugin might not be correct anymore leading to a source set that is effectively not handled by anyone.
The hack is to add the following to all multiplatform modules:
kotlin {
sourceSets {
named("androidMain") {
kotlin.srcDir("src/commonMain/kotlin")
}
}
}
This hack works if there is only one target. It seems like everything should work without the hack when I add additional targets, but I don't have the resources now to test adding additional targets.
I attached a new version of the project where everything works. In order to see the issue, you can comment out the hack above in build-logic/src/main/kotlin/com/eygraber/galgal/gradle/kmp.kt
and you can see that commonMain
is no longer handled in the IDE.
ga...@google.com <ga...@google.com> #6
Thanks for the update, and for sharing the workaround. Fixing this will require bigger changes in the importing infrastructure as we have an assumption that Android should only set up source sets it is aware of (we are not aware of commonMain
). Please continue using the workaround until we address this in KMP/Android import.
ja...@gmail.com <ja...@gmail.com> #7
Can you please share an update for this issue ?
Thanks...
ga...@google.com <ga...@google.com> #8
No new updates since #6, we will not be able to work on this before Q3 2022.
so...@google.com <so...@google.com> #9
Dependencies and symbols are resolved in the original project when opened in the current version from HEAD
.
mi...@weather.com <mi...@weather.com> #10
Do we know what version of Android Studio the fix will be rolling out to?
so...@google.com <so...@google.com> #11
I believe an automatic comment is added to the issue when the fix is included in a release.
ey...@gmail.com <ey...@gmail.com> #12
Was this ever released?
so...@google.com <so...@google.com> #13
Electric Eel Canary 9
Description
I'm using Kotlin 1.6.21 and Gradle 7.4.2, Bumblebee 3, Chipmunk RC 2, and Dolphin Alpha 9 for AS and AGP.
There are 2 separate issues:
I can solve #1 by using Bumblebee AGP. Anything higher than that breaks.
I can solve #2 by setting
kotlin.mpp.hierarchicalStructureSupport=false
ingradle.properties