Im having an issue with KMM I just ran the wizard ...
# multiplatform
e
Im having an issue with KMM I just ran the wizard project then I tried to add Ktor and getting this errors. I have M1 and using Kotlin 1.5.30
Copy code
shared:compileKotlinIos FAILED 
Could not resolve io.ktor:ktor-client-core:1.6.1.
s
You should thread big messages like this. Also look three messages up. https://kotlinlang.slack.com/archives/C3PQML5NU/p1629917120375100. You’ll be able to run your app using the “My Mac (Designed for iPad) target but not in the simulator until iosSimulatorArm64 binaries are published.
e
So should I wait for the dependency? or there is another approach I can do?
l
@Emiliano Schiavone Please, edit your message and put the error message in a text snippet in this thread to not flood the main channel.
e
Copy code
Execution failed for task ':shared:compileKotlinIos'.
> Could not resolve all files for configuration ':shared:iosCompileKlibraries'.
   > Could not resolve io.ktor:ktor-client-core:1.6.1.
     Required by:
         project :shared
      > No matching variant of io.ktor:ktor-client-core:1.6.1 was found. The consumer was configured to find a usage of 'kotlin-api' of a component, 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 'commonMainMetadataElements' capability io.ktor:ktor-client-core:1.6.1 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 '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_simulator_arm64')
          - Variant 'iosArm32ApiElements-published' capability io.ktor:ktor-client-core:1.6.1 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_arm32' and the consumer needed a component, as well as attribute 'org.jetbrains.kotlin.native.target' with value 'ios_simulator_arm64'
          - Variant 'iosArm32MetadataElements-published' capability io.ktor:ktor-client-core:1.6.1 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_arm32' 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'
          - Variant 'iosArm64ApiElements-published' capability io.ktor:ktor-client-core:1.6.1 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'
          - Variant 'iosArm64MetadataElements-published' capability io.ktor:ktor-client-core:1.6.1 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'
          - Variant 'iosX64ApiElements-published' capability io.ktor:ktor-client-core:1.6.1 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'
          - Variant 'iosX64MetadataElements-published' capability io.ktor:ktor-client-core:1.6.1 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'
          - Variant 'jsIrApiElements-published' capability io.ktor:ktor-client-core:1.6.1 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 attribute:
l
If you look closely, you'll see your project sets a target the library doesn't have yet (
io_simulator_arm64
). The solution is to remove this target until a future version of #ktor supports it.
e
yes but removing that I have another issue that I fixed adding the ioSimulatorArm64
Got
embedAndSignAppleFrameworkForXcode
issue without
ioSimulatorArm64
l
Well, at least, you now know what leads to this error message so you can pick your poison until ktor gets a newer release.
e
yep, thanks!