Hello Everyone! Help please. I want to use the gRP...
# multiplatform
е
Hello Everyone! Help please. I want to use the gRPC-Swift library via cocoapods in iosMain. Added cocoapods to the build configuration.gradle.kts
Copy code
cocoapods {
    summary = "Some description for the Shared Module"
    homepage = "Link to the Shared Module homepage"
    version = "1.0"
    ios.deploymentTarget = "14.1"
    podfile = project.file("../iosApp/Podfile")
    framework {
        baseName = "shared"
    }

    pod("gRPC-Swift")
}
However, when starting gradle, the following error occurs
Copy code
> Task :shared:cinteropGRPC_SwiftIosSimulatorArm64
Exception in thread "main" java.lang.Error: /var/folders/yf/31hpz0m533xcg2yhcgtld8nxsrc62v/T/8169107376756750983.m:1:9: fatal error: module 'gRPC_Swift' not found
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:274)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:75)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:522)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:290)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:219)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:80)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:40)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:62)
Any ideas why this is happening and how to fix it?
j
Kotlin doesn't support interop with pure Swift modules yet. You should be able to use the gRPC Objective-C library instead.
е
I didn’t know about it, Thank You! Corrected the configuration in
build.gradle.kts
Copy code
cocoapods {
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        version = "1.0"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
        }

        pod("gRPC")
    }
I still get the same error
Copy code
Exception in thread "main" java.lang.Error: /var/folders/yf/31hpz0m533xcg2yhcgtld8nxsrc62v/T/8058504039399904124.m:1:9: fatal error: module 'gRPC' not found
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:274)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:75)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:522)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:290)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:219)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:80)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:40)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:62)
j
е
It worked! Thank you very much, you helped me save a lot of hours of Internet scrolling