redux-kotlin
redux-kotlin copied to clipboard
Error building KMM project for Arm64 simulator
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:

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 😁
Have a PR https://github.com/reduxkotlin/redux-kotlin/pull/103 for this waiting for approval
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.
@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
@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.
Any news here?
All the missing kotlin targets were added and will be published with 0.6.0 release soon. Apologies for MASSIVE delays.
Compose support will land as soon as compose 1.3.0 drops via https://github.com/reduxkotlin/redux-kotlin-compose
Closed by #114