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

Mohammed Toufeeq Ahamed

10/19/2023, 5:41 PM
Hey guys, I have been playing with Tivi Compose Multiplatform app, I was trying it out only for iOS and Android, commented out the jvm() target and also removed jvmMain sourcesets from corresponding modules, but turns out the the code in
commonMain is not accessible in androidMain
folders, is there an issue with configuration or it this issue which was reported in earlier verions of AS. I'm running the latest version of AS. @cb any idea why this is happening ? With the repo cloned as is, it just works fine. Issue occurs when jvm() is removed.
p

Pablichjenkov

10/19/2023, 5:56 PM
I haven't checked tivi recently but judging by the name,
jvm
seems like a custom target which Android depends on. I would advise opening an issue/question in the GitHub repo before opening a ticket in YouTrack. You might get quicker response.
Oh sorry, I didn't read above when you mentioned it compiles and runs without issues. So seems to be an ide thing. Disregard my message above
m

Mohammed Toufeeq Ahamed

10/19/2023, 6:03 PM
It runs when no changes are made to the code base. When I remove jvm() it errors out.
jvm
seems like a custom target which Android depends on.
as far I can understand, jvm is a desktop target
p

Pablichjenkov

10/19/2023, 6:08 PM
Of sorry, you are correct, the target name is
jvm
, I thought jvm was referring to a custom sourceSet instead of
desktopMain
I would review the sourceSet part. Make sure that in the sourceSet nothing references the jvm Target you removed. If you could reference the file in that project would be easier.
m

Mohammed Toufeeq Ahamed

10/19/2023, 6:44 PM
This is what I was trying to achive, remove jvm and just run ios and android, before and after code changes screenshots. Let me know if Im doing anything wrong? Thanks.
p

Pablichjenkov

10/19/2023, 7:39 PM
First you should notice those modules use a custom Gradle convention plugin. Check the code in buildSrc to see if it depends on something in the jvmMain.
Another thing to check, if you remove one target in a module, you have to remove it in the dependent modules.
2 Views