Hey, I'm trying to add a CocoaPod dependency to my...
# multiplatform
j
Hey, I'm trying to add a CocoaPod dependency to my KMM project and the build process keeps failing due to compiler errors during the cinterop task. But Gradle isn't telling me what the compiler error is, it is only telling me that a fatal error occurred. Even when I run with --info or --debug options, I don't get any more details about the compiler error. How can I get information from cinterop so that I can see what the problem is?
k
Unfortunately, better
cinterop
error messages are going to be available only after Kotlin 1.6.20 is released. You can track it here: https://youtrack.jetbrains.com/issue/KT-35059 Could you share what kind of pod you are trying to add? I recently faced some similar problem, that I described here and maybe I could help you
j
Thanks for those links; I believe I am running into the same issue described here. I am going to try upgrading to EAP 1.6.0 RC and will report back.
k
Most common issue when using XCode 13. For me, adding these lines helped:
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess::class.java) {
    settings.compilerOpts("-DNS_FORMAT_ARGUMENT(A)=")
}
👀 2
j
You used that fix with Xcode 13 and Kotlin 1.5.31?
k
Yes, exactly
j
@KamilH thanks, I believe that your code snipped has fixed my problem. I am able to successfully add a dependency on AFNetworking, and I am now when I add dependencies on the pods I actually want to use, I am now getting more detailed error messages about specific issues with their Objective-C code, rather than the generic messages I was getting before. I'll tentatively say this is solved.
k
Glad to hear that. Happy coding!