Really multi-platform modules can not be connected...
# multiplatform
l
Really multi-platform modules can not be connected to each other as usual? it's not very convenient to work with them in this case
z
They can, why not?
l
when I try to connect it I get a message saying that I can't find the project with this path
only publication in the local maven repository helps
z
I have a sample setup here (just to show the issue of navigation between modules) https://github.com/zalewskise/KMP-modules-issue Maybe it will help you
l
strange, everything seems to be the same, but I get an error: Unable to resolve dependency for ':core_network@debugAndroidTest/compileClasspath': Could not resolve project :core.
kotlin { jvm("android") sourceSets["commonMain"].dependencies { implementation(project(":core")) } sourceSets["androidMain"].dependencies { } }
Do I need to specify any additional settings?
k
is core included in settings.gradle?
l
Yes
include(":app") include(":core_network") include(":detect") include(":core") include(":domain") include(":f_main") include(":s_remote") rootProject.name = "Sample MultiModule"
it is strange that when you try to connect this module to a regular android module everything works
k
and project core is using Gradle metadata?
i don't think i have tried adding a MPP as a common dependency in another MPP
l
what do you mean metadata?
k
does
core
have a jvm target?
l
Yes
k
and what version of Gradle are you using?
l
4.0.0
k
that's your problem
4.0 is ancient as far as Gradle is concerned
l
I confused in my opinion, in gradle-wrapper.properties version is 6.5.1, and in project classpath gradle 4.0.0
k
one of those is Gradle and the other is the Android gradle plugin
ok, in that case I am not sure what the issue is. everything seems to check out
l
sadly
r
It might help if you put an empty
build.gradle.kts
in
common
and also include
:common
in
settings.gradle.kts
. I think I've seen gradle fail to resolve nested modules without that.
l
I have all the modules at the root, I do not think that this will help
r
Oh sorry, I was looking at Sebastian's setup and thought it was yours
l
@Kris Wong I noticed that your project requires version of Android Studio 4.2. I am currently using version 4.0.0. can the problem be in the version of Android Studio?
I don't understand, I updated the studio, made the configuration identical to yours and at the same time everything works in your project, but not in mine. I haven't come up with anything better than remaking your project by adding my sources there, I still can't understand what the problem is
@Kris Wong which is funny, in your version, when connecting the module, a direct link is also not created, if I try to switch from the repository module to the class defined in the network module, I'm not going to this class directly, but to the kotlin_metadata file, which is obviously not editable
it seems this functionality is still not finalized
z
Copy code
I'm not going to this class directly, but to the kotlin_metadata file,
This is a known issue: https://youtrack.jetbrains.com/issue/KT-39571
l
no solution yet?