reduxkotlin / redux-kotlin

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

Error building KMM project for Arm64 simulator #96

Closed nesfeder closed 1 year ago

nesfeder commented 2 years ago

Hey y'all, I'm experiencing a build error (see below for gradle log output) in my KMM project after adding

implementation("org.reduxkotlin:redux-kotlin-threadsafe:0.5.5")
implementation("org.reduxkotlin:redux-kotlin-thunk:0.5.5")

to my commonMain dependencies.

This seems to only be an issue for Arm64 simulator as the build passes when deploying to a physical device. Possibly similar to https://youtrack.jetbrains.com/issue/KT-49417?

> Task :shared:compileKotlinIosSimulatorArm64 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shared:compileKotlinIosSimulatorArm64'.
> Could not resolve all files for configuration ':shared:iosSimulatorArm64CompileKlibraries'.
   > Could not resolve org.reduxkotlin:redux-kotlin-threadsafe:0.5.5.
     Required by:
         project :shared
      > No matching variant of org.reduxkotlin:redux-kotlin-threadsafe:0.5.5 was found. The consumer was configured to find a usage of 'kotlin-api' of a library, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native', attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64' but:
          - Variant 'iosArm64-api' capability org.reduxkotlin:redux-kotlin-threadsafe:0.5.5 declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64'
              - Other compatible attributes:
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          - Variant 'iosArm64-iosArm64MetadataElements' capability org.reduxkotlin:redux-kotlin-threadsafe:0.5.5 declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
              - Incompatible because this component declares a usage of 'kotlin-metadata' of a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_arm64' and the consumer needed a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64'
              - Other compatible attributes:
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          - Variant 'iosX64-api' capability org.reduxkotlin:redux-kotlin-threadsafe:0.5.5 declares a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64'
              - Other compatible attributes:
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          - Variant 'iosX64-iosX64MetadataElements' capability org.reduxkotlin:redux-kotlin-threadsafe:0.5.5 declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':
              - Incompatible because this component declares a usage of 'kotlin-metadata' of a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64' and the consumer needed a usage of 'kotlin-api' of a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64'
              - Other compatible attributes:
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
          - Variant 'jsIr-api' capability org.reduxkotlin:redux-kotlin-threadsafe:0.5.5 declares a usage of 'kotlin-api' of a component:
              - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'js' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'
              - Other compatible attributes:
                  - Doesn't say anything about its component category (required a library)
                  - Doesn't say anything about its target Java environment (preferred optimized for non-jvm)
                  - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_simulator_arm64')
...

Anything I can do to address this? I've also attached a sample project that reproduces the issue. And here's my iosApp config I'm using to run the build from Android Studio:

Screen Shot 2022-02-01 at 12 26 39 PM

Project to reproduce: MyApplication.zip

If y'all are already aware of this or a fix is known, please close this - I apologize if I missed it 😁

Syrou commented 2 years ago

Have a PR https://github.com/reduxkotlin/redux-kotlin/pull/103 for this waiting for approval

1gravity commented 2 years ago

This repo doesn't seem to be maintained any more so I forked it and fixed this issue (plus did a good amount of migrations and refactoring) here https://github.com/1gravity/redux-kotlin. Since I can't publish under org.reduxkotlin I created new artifacts. You can test this and let me know if it works for you:

implementation("com.1gravity.redux:redux-kotlin-threadsafe:0.5.8-SNAPSHOT")

This also includes the redux-kotlin-thunk artifact because that one is a single file so I included it into the core library. I can also create a pr for this repo if the maintainers want to integrate it.

Syrou commented 2 years ago

@1gravity I just referenced your fork in https://github.com/reduxkotlin/redux-kotlin/pull/94 to start perhaps adding compose to your fork, at the very least we probably should start looking into a more active fork

1gravity commented 2 years ago

@Syrou I saw that someone already took ownership of this repo. It's either adding compose functionality to my fork or merging all my changes back into this repo (I made a lot of changes). I guess it depends on how active the new maintainer is. I'm out for another 3 weeks and once I'm back I'll assess the best path forward.

melbic commented 1 year ago

Any news here?

mpetuska commented 1 year ago

All the missing kotlin targets were added and will be published with 0.6.0 release soon. Apologies for MASSIVE delays.

mpetuska commented 1 year ago

Compose support will land as soon as compose 1.3.0 drops via https://github.com/reduxkotlin/redux-kotlin-compose

mpetuska commented 1 year ago

Closed by #114