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

Loboda Deni

07/14/2020, 11:33 AM
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

zalewski.se

07/14/2020, 12:12 PM
They can, why not?
l

Loboda Deni

07/14/2020, 12:15 PM
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

zalewski.se

07/14/2020, 12:17 PM
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

Loboda Deni

07/14/2020, 12:29 PM
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

Kris Wong

07/14/2020, 12:47 PM
is core included in settings.gradle?
l

Loboda Deni

07/14/2020, 12:51 PM
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

Kris Wong

07/14/2020, 12:57 PM
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

Loboda Deni

07/14/2020, 12:58 PM
what do you mean metadata?
k

Kris Wong

07/14/2020, 1:01 PM
does
core
have a jvm target?
l

Loboda Deni

07/14/2020, 1:02 PM
Yes
k

Kris Wong

07/14/2020, 1:02 PM
and what version of Gradle are you using?
l

Loboda Deni

07/14/2020, 1:03 PM
4.0.0
k

Kris Wong

07/14/2020, 1:03 PM
that's your problem
4.0 is ancient as far as Gradle is concerned
l

Loboda Deni

07/14/2020, 1:06 PM
I confused in my opinion, in gradle-wrapper.properties version is 6.5.1, and in project classpath gradle 4.0.0
k

Kris Wong

07/14/2020, 1:07 PM
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

Loboda Deni

07/14/2020, 1:09 PM
sadly
r

russhwolf

07/14/2020, 3:11 PM
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

Loboda Deni

07/14/2020, 3:14 PM
I have all the modules at the root, I do not think that this will help
r

russhwolf

07/14/2020, 3:15 PM
Oh sorry, I was looking at Sebastian's setup and thought it was yours
l

Loboda Deni

07/15/2020, 4:52 AM
@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

zalewski.se

07/15/2020, 8:22 AM
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

Loboda Deni

07/15/2020, 8:24 AM
no solution yet?
2 Views