Does anyone know how to deal with this error? I t...
# multiplatform
d
Does anyone know how to deal with this error? I think it’s because I’m using
Copy code
androidx.lifecycle:lifecycle-runtime-compose:2.9.0
along with plugin
Copy code
org.jetbrains.compose:1.8.1
which results in this errors
Copy code
Could not resolve all dependencies for configuration ':shared:addresses-ui:iosX64CompilationDependenciesMetadata'.
> Could not resolve androidx.lifecycle:lifecycle-runtime-compose:2.9.0.
  Required by:
      project :shared:addresses-ui > project :shared:designsystem
   > No matching variant of androidx.lifecycle:lifecycle-runtime-compose:2.9.0 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64', attribute 'org.jetbrains.kotlin.platform.type' with value 'native' but:
       - Variant 'androidxSourcesElements':
           - Incompatible because this component declares documentation for use during 'androidx-multiplatform-docs' and the consumer needed a library for use during 'kotlin-metadata'
(more in thread)
Full stacktrace
Copy code
org.gradle.api.internal.tasks.TaskDependencyResolveException: Could not determine the dependencies of task ':shared:addresses-ui:transformCommonMainDependenciesMetadata'.	
at org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext.getDependencies(CachingTaskDependencyResolveContext.java:70)	
•••
Caused by: org.gradle.api.internal.artifacts.ivyservice.TypedResolveException: Could not resolve all dependencies for configuration ':shared:addresses-ui:iosX64CompilationDependenciesMetadata'.	
at org.gradle.api.internal.artifacts.ResolveExceptionMapper.mapFailures(ResolveExceptionMapper.java:58)	
•••
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve androidx.lifecycle:lifecycle-runtime-compose:2.9.0.	
Required by:	
    project :shared:addresses-ui > project :shared:designsystem	
Caused by: org.gradle.internal.component.resolution.failure.exception.VariantSelectionByAttributesException: No matching variant of androidx.lifecycle:lifecycle-runtime-compose:2.9.0 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64', attribute 'org.jetbrains.kotlin.platform.type' with value 'native' but:	
  - Variant 'androidxSourcesElements':	
      - Incompatible because this component declares documentation for use during 'androidx-multiplatform-docs' and the consumer needed a library for use during 'kotlin-metadata'	
      - Other compatible attributes:	
          - 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_x64')	
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')	
  - Variant 'jvmStubsApiElements-published' declares a library for use during compile-time, preferably optimized for standard JVMs:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'jvmStubsRuntimeElements-published' declares a library for use during runtime, preferably optimized for standard JVMs:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'jvmStubsSourcesElements-published' declares a component for use during runtime, preferably optimized for standard JVMs:	
      - Incompatible because this component declares documentation, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'libraryVersionMetadata':	
      - Incompatible because this component declares documentation for use during 'library-version-metadata' and the consumer needed a library for use during 'kotlin-metadata'	
      - Other compatible attributes:	
          - 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_x64')	
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')	
  - Variant 'linuxx64StubsApiElements-published' declares a library for use during 'kotlin-api', preferably optimized for non-jvm, 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 'linux_x64' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64'	
  - Variant 'linuxx64StubsSourcesElements-published' declares a component, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':	
      - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' and the consumer needed a library for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64'	
  - Variant 'metadataApiElements' declares a library for use during 'kotlin-metadata', preferably optimized for non-jvm:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'metadataSourcesElements' declares a component, preferably optimized for non-jvm:	
      - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a library for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'releaseApiElements-published' declares a library for use during compile-time, preferably optimized for Android:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'releaseRuntimeElements-published' declares a library for use during runtime, preferably optimized for Android:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'releaseSourcesElements-published' declares a component for use during runtime, preferably optimized for Android:	
      - Incompatible because this component declares documentation, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
at org.gradle.internal.component.resolution.failure.describer.NoCompatibleVariantsFailureDescriber.describeFailure(NoCompatibleVariantsFailureDescriber.java:58)	
•••
Caused by: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve androidx.lifecycle:lifecycle-runtime-compose:2.9.0.	
Required by:	
    project :shared:addresses-ui > org.jetbrains.compose.ui:ui:1.8.0 > org.jetbrains.compose.ui:ui-uikitx64:1.8.0 > org.jetbrains.androidx.lifecycle:lifecycle-common:2.9.0-alpha03 > androidx.lifecycle:lifecycle-common:2.9.0-alpha03 > androidx.lifecycle:lifecycle-common-iosx64:2.9.0-alpha03	
    project :shared:addresses-ui > org.jetbrains.compose.ui:ui:1.8.0 > org.jetbrains.compose.ui:ui-uikitx64:1.8.0 > org.jetbrains.androidx.lifecycle:lifecycle-runtime:2.9.0-alpha03 > androidx.lifecycle:lifecycle-runtime:2.9.0-alpha03 > androidx.lifecycle:lifecycle-runtime-iosx64:2.9.0-alpha03	
    project :shared:addresses-ui > org.jetbrains.compose.ui:ui:1.8.0 > org.jetbrains.compose.ui:ui-uikitx64:1.8.0 > org.jetbrains.androidx.lifecycle:lifecycle-viewmodel:2.9.0-alpha03 > androidx.lifecycle:lifecycle-viewmodel:2.9.0-alpha03 > androidx.lifecycle:lifecycle-viewmodel-iosx64:2.9.0-alpha03
Copy code
Caused by: org.gradle.internal.component.resolution.failure.exception.VariantSelectionByAttributesException: No matching variant of androidx.lifecycle:lifecycle-runtime-compose:2.9.0 was found. The consumer was configured to find a library for use during 'kotlin-metadata', preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64', attribute 'org.jetbrains.kotlin.platform.type' with value 'native' but:	
  - Variant 'androidxSourcesElements':	
      - Incompatible because this component declares documentation for use during 'androidx-multiplatform-docs' and the consumer needed a library for use during 'kotlin-metadata'	
      - Other compatible attributes:	
          - 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_x64')	
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')	
  - Variant 'jvmStubsApiElements-published' declares a library for use during compile-time, preferably optimized for standard JVMs:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'jvmStubsRuntimeElements-published' declares a library for use during runtime, preferably optimized for standard JVMs:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'jvmStubsSourcesElements-published' declares a component for use during runtime, preferably optimized for standard JVMs:	
      - Incompatible because this component declares documentation, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'jvm' and the consumer needed a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'libraryVersionMetadata':	
      - Incompatible because this component declares documentation for use during 'library-version-metadata' and the consumer needed a library for use during 'kotlin-metadata'	
      - Other compatible attributes:	
          - 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_x64')	
          - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'native')	
  - Variant 'linuxx64StubsApiElements-published' declares a library for use during 'kotlin-api', preferably optimized for non-jvm, 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 'linux_x64' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64'	
  - Variant 'linuxx64StubsSourcesElements-published' declares a component, preferably optimized for non-jvm, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native':	
      - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.native.target' with value 'linux_x64' and the consumer needed a library for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_x64'	
  - Variant 'metadataApiElements' declares a library for use during 'kotlin-metadata', preferably optimized for non-jvm:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'metadataSourcesElements' declares a component, preferably optimized for non-jvm:	
      - Incompatible because this component declares documentation for use during 'kotlin-runtime', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'common' and the consumer needed a library for use during 'kotlin-metadata', as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'releaseApiElements-published' declares a library for use during compile-time, preferably optimized for Android:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'releaseRuntimeElements-published' declares a library for use during runtime, preferably optimized for Android:	
      - Incompatible because this component declares a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
  - Variant 'releaseSourcesElements-published' declares a component for use during runtime, preferably optimized for Android:	
      - Incompatible because this component declares documentation, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' and the consumer needed a library, as well as attribute 'org.jetbrains.kotlin.platform.type' with value 'native'	
      - Other compatible attribute:	
          - Doesn't say anything about org.jetbrains.kotlin.native.target (required 'ios_x64')	
at org.gradle.internal.component.resolution.failure.describer.NoCompatibleVariantsFailureDescriber.describeFailure(NoCompatibleVariantsFailureDescriber.java:58)
i
You need multiplatform fork
org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose:2.9.0
d
yeah, thanks i figured it out - i think this should be in the compose multiplatform documentation
👍 1
i
It should be already there. I see it in viewmodel page as well as in release notes/what's new pages. What page are you referring to?
d
sorry I mean that there should be something more prominent saying the dependency to use in CMP is NOT the one you use for Android. I assumed it was the same and I didn’t notice that it actually had a different group name