Hello everyone. I am working on a KMM project that...
# multiplatform
k
Hello everyone. I am working on a KMM project that aims to support Android and JVM platforms. It works well at first until I want to add the source code to the artifact and publish them together so that the main project that integrates the KMM can debug the source code. There are different problems for Android and JVM:
p
I think that depending on where you place the publish plugin it will publish that. If you are in an Android only sourceset that is what it publishes. There is no much information provided so is hard to see what could be missing. Try to search for a project that already works and compare it with yours
k
I place the plugin in build.gradle under the shared folder. It will not publish the source set if we do not make any configuration. I post the configuration code above. I did search for the project but cannot find one that has the same situation as me.
p
Humm that's the right place. Are you publishing all the platforms. Just in case run an assemble or build task fist to make sure files are there. I have been using the standard configuration, no extra work and it publishes to central fine. Check if it works on your side. But there are plenty of open projects publishing libraries in GitHub. Good luck https://github.com/pablichjenkov/kmp-amadeus-api
k
Thanks for your help! I just want to publish the Android and JVM targets. I checked the link and I think it only publishes the source code in androidMain instead of commonMain. Thus, it will not encounter the duplicated file error. However, I think it is necessary to include the source code in commonMain. Do you have a method to solve that problem? Thanks again!
Or if it is possible for you to post your build.gradle?