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

pablisco

10/06/2023, 9:04 PM
I’m having an issue where I have two kmp modules, one depends on the other, but the later doesn’t see the code in the first module. I’ve tried so far: • Adding a package to
authService
• Removing the two targets on the consumer module (
prod
and
dev
normally) • Adding the relevant targets to the imported module to match that of the consumer None of these seem to work, so I’m a bit lost to what I may be doing wrong 🙃 Anyone had a similar issue before?
PS, it’s not an IDE issue as the same error happens when running the app from command line
m

mbonnin

10/07/2023, 2:42 PM
Try adding the import manually?
p

pablisco

10/07/2023, 2:44 PM
Yeah, for now I've ended up making it a plain jvm module and that seems to be ok. I'll have to find a different way to load Dev/prod config 😅 not the end of the world
m

mbonnin

10/07/2023, 2:45 PM
Yea, I think different compilations is the new way to go
💯 1
p

pablisco

10/07/2023, 2:46 PM
Yeah, although, we don't get the expect/actual options that multiple targets offer, do we?
m

mbonnin

10/07/2023, 2:47 PM
I don't think so 😞
p

pablisco

10/07/2023, 2:47 PM
And the IDE seemed very confused about having multiple compilations 🙃 but we'll get there 🤞
The lack of expected can probably be resolved with an interface and multiple implementations on each compilation with the same name (as it's possible with AGP). Just need that lovely IDE support 😅
*actually, we don't need the interface in that scenario
m

mbonnin

10/07/2023, 3:11 PM
Was able to get
expect
working actually using a manual sourceSet: https://github.com/martinbonnin/test-compilations/blob/main/build.gradle.kts
The weirdest thing is that it doesn't recognize "println" 🤷
😅 1
But expect/actual is working fine in different jvm compilations
p

pablisco

10/07/2023, 3:12 PM
Oh, that’s good to hear. I’ll try that 🙂
👍 1
c

CLOVIS

10/09/2023, 9:10 AM
I'm not sure, but it looks to me like
AuthService.kt
has no
package
declaration? If so, that's why—you can't import things from the default package.
p

pablisco

10/09/2023, 9:20 AM
@CLOVIS It works without a package on jvm. Also, one of the things I said I tried was adding a package. But thanks for the suggestion.
c

CLOVIS

10/09/2023, 12:10 PM
Ah, sorry. Is it published anywhere? I have a lot of multi-project KMP repositories, so I'm sure it's possible, but I don't see what the difference is
p

pablisco

10/09/2023, 4:13 PM
Not public yet. But I'll see if I can replicate it independently 🤞
m

mbonnin

10/17/2023, 1:37 PM
Was able to get
expect
working actually using a manual sourceSet
Welp, that doesn't work 😞 . I just realized it outputs a big warning:
Copy code
w: Following Kotlin Source Set groups can't depend on 'jvmCommon' together as they belong to different Kotlin Source Set Trees.
Source Sets from 'dev' Tree:
  * 'jvmDev'
Source Sets from 'prod' Tree:
  * 'jvmProd'
sad panda 1
I left a message here
3 Views