Kevin
06/24/2023, 3:09 AMandroid {
namespace = "com.kevinnzou.yxkmm"
compileSdk = 33
defaultConfig {
minSdk = 23
}
publishing {
singleVariant("release") {
withSourcesJar()
}
}
// sourceSets["main"].java.srcDirs("src/commonMain/kotlin")
sourceSets["main"].res.srcDirs("src/androidMain/res")
sourceSets["main"].resources.srcDirs("src/commonMain/resources")
}
However, this will only publish the source code inside src/androidMain/kotlin. That's why I have to add the commented code to add the commonMain to the souceSets. But it leads to another problem, Duplicated file Error. That is because the file name under the androidMain is the same as commonMain and sourceJar is trying to put them under the same package. To solve this problem, I can only rename the files under the androidMain folder which I don't think is a good solution. Thus, my first question is, is there any better solution for that problem?