KuiklyUI项目中引用Ktor库导致鸿蒙ohosArm64平台编译失败及解决方案分析

我看这个问题下 #70 说可以直接引用 KMP 库,但是为什么我引用 ktor 鸿蒙上编译不过?
`
Execution failed for task :shared:kspKotlinOhosArm64 .

Could not resolve all files for configuration :shared:ohosArm64CompileKlibraries .
Could not resolve io.ktor:ktor-server-netty:3.0.1.
Required by:
project :shared
> No matching variant of io.ktor:ktor-server-netty:3.0.1 was found. The consumer was configured to find a library for use during kotlin-api , preferably optimized for non-jvm, as well as attribute org.jetbrains.kotlin.native.target with value ohos_arm64 , attribute org.jetbrains.kotlin.platform.type with value native but:
– Variant jvmApiElements-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 ohos_arm64 )
– Variant jvmRuntimeElements-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 ohos_arm64 )
– Variant jvmSourcesElements-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 ohos_arm64 )
– Variant metadataApiElements declares a library, preferably optimized for non-jvm:
– Incompatible because this component declares a component for use during kotlin-metadata , as well as attribute org.jetbrains.kotlin.platform.type with value common and the consumer needed a component for use during kotlin-api , 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 ohos_arm64 )
– 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-api , 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 ohos_arm64 )
`

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 共7条

请登录后发表评论