reduxkotlin / redux-kotlin

Redux implementation for Kotlin (supports multiplatform JVM, native, JS, WASM)
https://reduxkotlin.org
MIT License
426 stars 32 forks source link

Duplicate class org.reduxkotlin.threadsafe.CreateThreadSafeStoreKt #148

Closed SylvainHocq closed 1 year ago

SylvainHocq commented 1 year ago

Hi i have an error during the buid of my app, when i try to migrate from version 0.5.5 to 0.6.0 (which it seem to be necessary to migrate from kotlin 1.7 to kotlin 1.8)

`Execution failed for task ':app:checkDebugDuplicateClasses'.

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable Duplicate class org.reduxkotlin.threadsafe.CreateThreadSafeStoreKt found in modules jetified-redux-kotlin-threadsafe-debug-runtime (org.reduxkotlin:redux-kotlin-threadsafe-android-debug:0.6.0) and jetified-redux-kotlin-threadsafe-jvm-0.6.0 (org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.6.0) Duplicate class org.reduxkotlin.threadsafe.CreateThreadSafeStoreKt$createTypedThreadSafeStore$$inlined$asTyped$1 found in modules jetified-redux-kotlin-threadsafe-debug-runtime (org.reduxkotlin:redux-kotlin-threadsafe-android-debug:0.6.0) and jetified-redux-kotlin-threadsafe-jvm-0.6.0 (org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.6.0)`

in the build.gradle of my app : dependencies { .... implementation "org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.6.0" .... }

in the build.gradle of my shared module : `kotlin { android()

val xcf = XCFramework()
listOf(
    iosX64(),
    iosArm64(),
).forEach {
    it.binaries.framework {
        baseName = "shared"
        xcf.add(this)
    }
}

sourceSets {
    val commonMain by getting {
        dependencies {
            ...
            implementation("org.reduxkotlin:redux-kotlin-threadsafe:0.6.0")
            ...` 

I think the problem come from my configuration. I would appreciate some help. Thanks.

mpetuska commented 1 year ago

Hi, sorry for late response - gh does not notify me on new issues for whatever reason...

Don't use -jvm suffix for android dependencies. Since version 0.6.0 we now publish proper android aar artifacts (-android suffix or no suffix at all)