andreshsingh / react-native-khalti-sdk

MIT License
15 stars 1 forks source link

Duplicate class kotlinx.serialization found while building debug application #8

Open Kushaan-Kz opened 7 months ago

Kushaan-Kz commented 7 months ago

I am getting the following error while building for android:

Duplicate class kotlinx.serialization.json.JsonPrimitive found in modules jetified-kotlinx-serialization-json-jvm-1.3 (org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3) and jetified-kotlinx-serialization-runtime-jvm-1.0-M1-1.4.0-rc (org.jetbrains.kotlinx:kotlinx-serialization-runtime-jvm:1.0-M1-1.4.0-rc) Duplicate class kotlinx.serialization.json.JsonPrimitive$Companion found in modules jetified-kotlinx-serialization-json-jvm-1.3 (org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3) and jetified-kotlinx-serialization-runtime-jvm-1.0-M1-1.4.0-rc (org.jetbrains.kotlinx:kotlinx-serialization-runtime-jvm:1.0-M1-1.4.0-rc) Duplicate class kotlinx.serialization.json.JsonPrimitiveSerializer found in modules jetified-kotlinx-serialization-json-jvm-1.3 (org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3) and jetified-kotlinx-serialization-runtime-jvm-1.0-M1-1.4.0-rc (org.jetbrains.kotlinx:kotlinx-serialization-runtime-jvm:1.0-M1-1.4.0-rc) Duplicate class kotlinx.serialization.json.JsonTransformingSerializer found in modules jetified-kotlinx-serialization-json-jvm-1.3 (org.jetbrains.kotlinx:kotlinx-serialization-json-jvm:1.3.3) and jetified-kotlinx-serialization-runtime-jvm-1.0-M1-1.4.0-rc (org.jetbrains.kotlinx:kotlinx-serialization-runtime-jvm:1.0-M1-1.4.0-rc)

this is due to the dependency in Khalti's Android SDK where: classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"

react-native: 0.66.5 OS: MacOS (arm)

Android Config:

buildToolsVersion = "30.0.2" minSdkVersion = 21 compileSdkVersion = 33 kotlinVersion = "1.6.0" targetSdkVersion = 33 ndkVersion = "21.4.7075529"

I cannot find a solution.. If possible can you please help me on this.. need it asap.

niyon-x commented 2 months ago

@Kushaan-Kz were you able to find a solution to it?