KamilH
09/29/2021, 11:41 AMAbly
). My gradle sync fails on cinterop
task (shared:cinteropAblyIos
to be specific) with the message:
Exception in thread "main" java.lang.Error: /var/folders/2q/gjhd6ng16j51tnmw772w02k40000gp/T/5129966869508006261.m:1:9: fatal error: could not build module 'Ably'
I tried to check whether I’m able to import some other cocoapods dependency and for example I can import AFNetworking
and use it, but when I try to import Ably it doesn’t work
What is the reason it fails? It’s something wrong with the dependency itself?KamilH
09/29/2021, 11:42 AMcocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
ios.deploymentTarget = "14.1"
frameworkName = "shared"
pod("Ably") {
version = "~> 1.2"
}
podfile = project.file("../iosApp/Podfile")
}
xiaobailong24
09/29/2021, 11:50 AMKamilH
09/29/2021, 11:56 AMmatej
09/29/2021, 12:53 PMbuild.gradle
and see if it helps:
extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=")
You should also probably update to Kotlin 1.5.31, there was at least one cinterop bugfix in there that I know of.KamilH
09/29/2021, 2:06 PMpod("Ably") {
version = "~> 1.2"
extraOpts = listOf("-compiler-option", "-DNS_FORMAT_ARGUMENT(A)=")
}
and I’m still getting the same error. I also updated to the latest XCode (13.0, before I was on 12.5) version and still the samematej
09/29/2021, 2:25 PMcocoapods {
tasks.withType(org.jetbrains.kotlin.gradle.tasks.CInteropProcess::class.java) {
settings.compilerOpts("-DNS_FORMAT_ARGUMENT(A)=")
}
}
KamilH
09/29/2021, 2:27 PMmatej
09/29/2021, 2:30 PMcinterop
in Kotlin's issue tracker: https://youtrack.jetbrains.com/issues?q=project:%20Kotlin
If you don't find anything that helps move forward, you can create a new issue and attach a small reproducer project. They're pretty responsive over there.Brendan Goldberg
09/29/2021, 2:31 PMgradle.properties
kotlin.mpp.enableCInteropCommonization=true
as well as the above mentioned compiler optionBrendan Goldberg
09/29/2021, 2:32 PMBrendan Goldberg
09/29/2021, 2:33 PMKamilH
09/29/2021, 2:35 PMxiaobailong24
09/30/2021, 11:42 AMcocoapods {
pod("msgpack", "0.4.0")
pod("AblyDeltaCodec", "1.3.1")
// pod("Ably", "1.2.6")
}
I have try add dependencies on msgpack
and AblyDeltaCodec
, it is successful.
but add Ably
then got same error:`cinteropAblyIosArm64 FAILED. fatal error: could not build module 'Ably'`