Skip to content

Error building KMM project for Arm64 simulator  #96

Closed
@nesfeder

Description

@nesfeder

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 😁

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions