Android Studio 向Kotlin多平台添加pod依赖项导致编译错误(非零退出代码1)

zujrkrfu  于 2023-10-23  发布在  Android
关注(0)|答案(1)|浏览(90)

在我的Kotlin多平台移动的项目中使用pod依赖项(在我的例子中,它是lottie-ios)导致它根本无法编译,并出现以下错误:
Failed to generate cinterop for :shared:cinteropLottie-iosIosArm64: Process 'command '/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java'' finished with non-zero exit value 1
这是我的cocoapods块:

cocoapods {
        summary = "Common Code (Platform-agnostic)"
        homepage = "."
        version = "1.0.0"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
        }

        pod("lottie-ios") {
            version = "4.3.3"
        }
    }
mw3dktmi

mw3dktmi1#

基于这个ticket solution,我需要更改我的pod依赖块,以确保模块名称与我将模块导入Swift文件时相同,这是结果:

pod("lottie-ios") {
    moduleName = "Lottie" //The module name is the same as when you do "import" in a swift file (import Lottie)
    version = "4.3.3"
}

如果我使用任何其他模块名称,它将无法编译。

相关问题