Xcode由于共享而无法构建KMM项目:linkpoddebugframeworkios

发布于 2025-01-26 01:09:13 字数 2409 浏览 5 评论 0原文

我正在用KMM构建一个小型项目,它在Android上构建完美,但无法用Xcode构建它。还安装了Cocoapods,而没有任何错误。

我正在使用的内容:

  • MacBook Air M1
  • Kotlin 1.6.10,
  • Gradle 7.3.0-Alpha03
  • ktor 1.5.2,
  • sqldelight 1.4.3,

您可以在此处找到该项目: https://github.com/piotrkedra/piotrkedra/comperative-perative-perative-pperative-analysission-analysis-of-kmm-fllutter - 回答本地/树/master/preapp-kmm

我遇到的错误:

...

> Task :shared:linkPodDebugFrameworkIos FAILED
e: Compilation failed: Backend Internal error: Exception during IR lowering
File being compiled: /opt/buildAgent/work/b2fef8360e1bcf3d/formats/json/commonMain/src/kotlinx/serialization/json/internal/TreeJsonDecoder.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.ir.util.IrFakeOverrideUtilsKt.getTarget(IrFakeOverrideUtils.kt:24)

* Source files: 
* Compiler version info: Konan: 1.6.10 / Kotlin: 1.6.10
* Output kind: FRAMEWORK

e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /opt/buildAgent/work/b2fef8360e1bcf3d/formats/json/commonMain/src/kotlinx/serialization/json/internal/TreeJsonDecoder.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.ir.util.IrFakeOverrideUtilsKt.getTarget(IrFakeOverrideUtils.kt:24)

...

Caused by: java.lang.IllegalStateException: Could not resolveFakeOverride() for FUN FAKE_OVERRIDE name:decodeNullableSerializableElement visibility:public modality:OPEN <T> ($this:kotlinx.serialization.encoding.CompositeDecoder, descriptor:kotlinx.serialization.descriptors.SerialDescriptor, i:kotlin.Int, deserializer:kotlinx.serialization.DeserializationStrategy<T of kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeNullableSerializableElement?>) returnType:T of kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeNullableSerializableElement? [fake_override]
at org.jetbrains.kotlin.ir.util.IrFakeOverrideUtilsKt.getTarget(IrFakeOverrideUtils.kt:24)

...


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shared:linkPodDebugFrameworkIos'.
> Compilation finished with errors

I am building a small project with KMM, it builds perfectly fine on android but cannot build it in XCode. Cocoapods was also installed an genereted without any erros.

What I'm using:

  • macbook air m1
  • Kotlin 1.6.10,
  • gradle 7.3.0-alpha03
  • Ktor 1.5.2,
  • SQLDelight 1.4.3,

You can find the project here: https://github.com/PiotrKedra/comperative-analysis-of-kmm-flutter-react-native/tree/master/preapp-kmm

The error I got:

...

> Task :shared:linkPodDebugFrameworkIos FAILED
e: Compilation failed: Backend Internal error: Exception during IR lowering
File being compiled: /opt/buildAgent/work/b2fef8360e1bcf3d/formats/json/commonMain/src/kotlinx/serialization/json/internal/TreeJsonDecoder.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.ir.util.IrFakeOverrideUtilsKt.getTarget(IrFakeOverrideUtils.kt:24)

* Source files: 
* Compiler version info: Konan: 1.6.10 / Kotlin: 1.6.10
* Output kind: FRAMEWORK

e: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /opt/buildAgent/work/b2fef8360e1bcf3d/formats/json/commonMain/src/kotlinx/serialization/json/internal/TreeJsonDecoder.kt
The root cause java.lang.IllegalStateException was thrown at: org.jetbrains.kotlin.ir.util.IrFakeOverrideUtilsKt.getTarget(IrFakeOverrideUtils.kt:24)

...

Caused by: java.lang.IllegalStateException: Could not resolveFakeOverride() for FUN FAKE_OVERRIDE name:decodeNullableSerializableElement visibility:public modality:OPEN <T> ($this:kotlinx.serialization.encoding.CompositeDecoder, descriptor:kotlinx.serialization.descriptors.SerialDescriptor, i:kotlin.Int, deserializer:kotlinx.serialization.DeserializationStrategy<T of kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeNullableSerializableElement?>) returnType:T of kotlinx.serialization.json.internal.AbstractJsonTreeDecoder.decodeNullableSerializableElement? [fake_override]
at org.jetbrains.kotlin.ir.util.IrFakeOverrideUtilsKt.getTarget(IrFakeOverrideUtils.kt:24)

...


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':shared:linkPodDebugFrameworkIos'.
> Compilation finished with errors

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

独自←快乐 2025-02-02 01:09:13

对于Kotlin 1.6.10,您需要基于Kotlin 1.6.10的KTOR。 KTOR 1.6.8是您需要的。您还需要将kotlinx.serialization倾斜到公共模块中。当前,您只有用于KTOR的插件(我猜您正在尝试将网络调用直接化为适当的数据类)。

For Kotlin 1.6.10, you need Ktor that was build on Kotlin 1.6.10. Ktor 1.6.8 is what you need. You will also need to inclode Kotlinx.serialization into the common module. Currently, you only have the plugin for Ktor (I'm guessing you are trying to deserialize network calls directly into appropriate data classes).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文