I'm trying to invest in kmp, but I feel like most ...
# multiplatform
e
I'm trying to invest in kmp, but I feel like most of my day is spent fighting the tooling instead of coding. Anyone else running into an issue where Android Studio can't resolve common dependencies (external and project)? Note that this is distinct from the issue where Intellij can't resolve common dependencies. https://issuetracker.google.com/issues/231701341
x
Felt like this when i first started. Spent most of the day fighting the build toolchain - especially whenever i decide to bump to use the latest version. With KMP, perseverance is the key. Re: your issue, do you see any issues when you do
./gradlew assemble
?
e
Nope, everything builds fine. It's just the IDE
x
what version of AS, gradle, agp and kmp plugin are you using?
e
Using Kotlin 1.6.21 and Gradle 7.4.2 I've tried: Bumblebee with AGP 7.1.3 and 7.2.0 Chipmunk with AGP 7.1.3 and 7.2.0 Dolphin Canary 9 with AGP 7.3.0-alpha09 The odd thing is that I got it to work last week with Bumblebee. Now it's back to not working. I even deleted and reinstalled all of my Android Studio installations and all settings / config, as well as Jetbrains Toolbox since a Jetbrains employee mentioned that some people had fixed their issues like that a few weeks ago.
m
I can’t help you with your specific issue but I can assure you that you are not alone with your statement “I feel like most of my day is spent fighting the tooling instead of coding”. Right at the moment I am fighting with a library which just builds and installs fine without any warning and even works flawlessly with my main project but IntelliJ IDEA is showing me all red in the editor because it cannot resolve a lot of dependencies.
r
I think I hit a very similar issue today. All was working fine but I updated Android Studio from Bumblebee to Chipmunk today and it looks like platform code (both main and test) doesn’t see commonMain.
When I compare the IDE state with a commit with previous kotlin/gradle versions which work fine, I see that Module Dependencies doesn’t list
commonMain
at all.
e
@Michael Paus with Intellij I had similar issues that was fixed by deleting the project's
.idea
and
.gradle
directories, then disabling Gradle's configuration cache, and reopening the project.
@Robert Wijas if the issue is only with resolving code from
commonMain
in your project, try setting
kotlin.mpp.hierarchicalStructureSupport=false
in your
gradle.properties
(if you're using Kotlin 1.6.20)
1
r
Thanks, looks like a good workaround for my case 🙏
👍 1