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

Michal Klimczak

05/05/2021, 6:23 AM
I'm slowly losing my mind over Android Studio Canary 15. Suddenly (it worked fine for a few days and then stopped) it went rogue with indexing and I can't fix it. I tried every trick in the book including removing android studio, restarting computer, removing AS settings etc. Everything from here as well: https://kotlinlang.slack.com/archives/CRDCFF3RC/p1618779620052500 Project builds just fine, it's just that Android studio doesn't index most classes, including very basic ones like platform.Foundation or any external libraries. It stopped marking the right directories as sources root like you see in the screenshot. I can mark them manually, but it doesn't fix the issue with indexing libraries or
platform.*
etc. I guess the problem is with it not properly collecting sources, but how do I fix it?
i

iamthevoid

05/05/2021, 6:35 AM
Try to build last stable commit. I met similar behavior when i was implementing sql delight.
The solution was is to separate ios targets
m

Michal Klimczak

05/05/2021, 6:39 AM
I already moved to my develop branch which worked fine yesterday. And I do have this separate ios targets. Maybe I'll try to move even further back in history
i

iamthevoid

05/05/2021, 6:48 AM
I don’t know then. BTW last friday i’ve downloaded AS canary 15 and after epic battle with buildSrc i’ve downgraded it to 14. It is poor advice, but maybe (if you have not enough time for example) it is better solution than stucking into build problems.
Maybe next version will be more stable
m

Michal Klimczak

05/05/2021, 6:50 AM
I'm struggling for a few hours now so I will probably try downgrading
@iamthevoid since you're so kind to help me - would you please tell me which version of jdk you have in you prefs? https://kotlinlang.slack.com/archives/CJLTWPH7S/p1618868738157900?thread_ts=1618852737.133800&cid=CJLTWPH7S
i

iamthevoid

05/05/2021, 7:01 AM
I use 11.0.10 (adoptopenjdk)
🙏 1
Tried to swith on 16.0.1 with no problems, but returned to 11
m

Michal Klimczak

05/05/2021, 7:56 AM
Okay, I solved it. Turns out it messed up on
androidTest/resources
. Gradle sync actually issued a warning:
Copy code
Unable to build Kotlin project configuration
org.gradle.api.InvalidUserDataException: Source directory '/Users/.../androidTest/resources/sample_book.xml' is not a directory.
When I removed resources it started working fine. To fix the issue I changed
resources
to
assets
.
r

rudolf.hladik

05/05/2021, 8:32 AM
do you have
Copy code
android {
    configurations {
        create("androidTestApi")
        create("androidTestDebugApi")
        create("androidTestReleaseApi")
        create("testApi")
        create("testDebugApi")
        create("testReleaseApi")
    }
}
before
Copy code
kotlin {
  ...
}
it’s a bug https://youtrack.jetbrains.com/issue/KT-43944
m

Michal Klimczak

05/05/2021, 9:36 AM
yes I do have that config
3 Views