Our Unity plugin has a dependency on an android only library (com.revenuecat.purchases:purchases) that has a dependency on kotlinx-serialization-json. Which itself has a compile dependency on kotlinx-serialization-json-jvm. This is in the pom file of kotlinx-serialization-json.
The thing is that it looks like both kotlinx-serialization-json-jvm and kotlinx-serialization-json share the same name for their kotlin_module. So when using the regular Android resolver (no mainTemplate.gradle), users of my plugin get this issue:
* What went wrong:
Execution failed for task ':unityLibrary:mergeDebugJavaResource'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
> 2 files found with path 'META-INF/kotlinx-serialization-json.kotlin_module' from inputs:
I was wondering if there's something built in the plugin to prevent this. From now I've recommended using mainTemplate.gradle resolution to use standard Maven dependencies or adding:
The fact that the dependency is <scope>compile</scope> in the pom also made me wonder if it is really necessary to download the .jar to compile the project. Isn't the kotlinx-serialization-json-1.4.1.jar already compiled code? Why do we need org.jetbrains.kotlinx.kotlinx-serialization-json-jvm-1.4.1.jar? This is probably me just misunderstanding how dependency resolution works in the context of Android development.
[REQUIRED] Please fill in the following fields:
[REQUIRED] Please describe the issue here:
Our Unity plugin has a dependency on an android only library (com.revenuecat.purchases:purchases) that has a dependency on
kotlinx-serialization-json
. Which itself has a compile dependency onkotlinx-serialization-json-jvm
. This is in the pom file ofkotlinx-serialization-json
.The thing is that it looks like both
kotlinx-serialization-json-jvm
andkotlinx-serialization-json
share the same name for theirkotlin_module
. So when using the regular Android resolver (no mainTemplate.gradle), users of my plugin get this issue:I see both files:
I was wondering if there's something built in the plugin to prevent this. From now I've recommended using
mainTemplate.gradle
resolution to use standard Maven dependencies or adding:The fact that the dependency is
<scope>compile</scope>
in the pom also made me wonder if it is really necessary to download the .jar to compile the project. Isn't thekotlinx-serialization-json-1.4.1.jar
already compiled code? Why do we needorg.jetbrains.kotlinx.kotlinx-serialization-json-jvm-1.4.1.jar
? This is probably me just misunderstanding how dependency resolution works in the context of Android development.Thanks