Quite often, classes in a multiplatform module won...
# multiplatform
z
Quite often, classes in a multiplatform module wont recognize classes from my other multiplatform modules ... unless I manually add their imports:
import integration.firestore.Firestore
. Anyone else seeing the same, or have any idea why that might be? Everything compiles just fine after adding the imports.
Furthermore, functions on said classes arent suggested while typing either; if I type them out manually - everything works.
j
Sounds like your IDE isn't properly up to date with your Gradle config. Try reloading or maybe even reimporting the project.
z
Thanks for the suggestion @Jorn Hertsig. Sometimes invalidating caches solves some (other, but multiplatform related) issues; however this doesnt seem to change at all. Ive just tried reimporting the project as well and no difference there either.
I am on a canary release of android studo though, so that might play into all of this.
a
sometimes clearing the .idea directory helps. It might have cached some old modules/directories that no longer exist.
z
@Adam S Thanks for the tip; no luck with that either unfortunately 😞
m
I have been suffering from this kind of errors for a long time now in Android Studio as well as in IntelliJ. Among them are missing import suggestions, false error indications, internal IDE errors, complete screen freezes and more. Working with multiplatform projects has really becoming a pain. Just recently IntelliJ entered an endless error reporting loop when I tried to submit the report for an internal IDE error and I had to finally kill IntelliJ to stop it. Manually deleting the projects .gradle and .idea folders helps sometimes.
z
Apparently this is also happening inside the same module:
Copy code
expect value class Batch(private val batch: BatchRef) {

    operator fun set(
        document: Document,
        data: Any,
    )

    suspend fun commit()
}

suspend fun test(batch: Batch) {
    <http://batch.com|batch.com> // nope
}
Sorry to hear that @Michael Paus, I came into this a while back knowing full well that Id run into issues at some point - its quite time consuming but at the end of the day Im sure they will work them out over time, and the time spent balance will.. hopefully be restored 😅 Ill try clearing the gradle folder as well. I think I can live with this issue for now, knowing that I can just type out the functions/imports manually, but Id like to be certain that its actually a bug in the IDE/KMM so that its not something Im doing wrong on my end of things.
m
@Zoltan Demant At least you know that you are not alone with the problem. That comforts you sometimes, even if it is no real help. 😉