https://kotlinlang.org logo
b

Bao Le Duc

06/30/2022, 7:14 AM
I’m using iOS cocoapods dependencies in my shared library.
Copy code
pod("AFNetworking") {
            version = "~> 4.0.1"
        }
        pod("AgoraRtcEngine_iOS")
both libraries are available from https://cocoapods.org/ and working with another (standalone) iOS project. However,
cinteropAgoraRtcEngine_iOSIosArm64
was failed and I got
Copy code
Exception in thread "main" java.lang.Error: /var/folders/3j/8k6z66l50dq_d1sjfxl8cphh0000gn/T/10429521223665112771.m:1:9: fatal error: module 'AgoraRtcEngine_iOS' not found
If I removed
pod("AgoraRtcEngine_iOS")
, it worked fine and I can
import cocoapods.AFNetworking.*
in iOS source-set Kotlin code. Any help are welcome!
r

ribesg

06/30/2022, 8:39 AM
Are you using Kotlin 1.7.0?
b

Bao Le Duc

06/30/2022, 8:39 AM
yes, Kotlin 1.7.0
r

ribesg

06/30/2022, 8:40 AM
Things changed on the cocoapods side with 1.7, try with 1.6.21
My iOS app currently doesn’t compile with Kotlin 1.7.0 because it fails to build a cocoapods dependency…
Only difference being 1.6.21 -> 1.7.0, so maybe try it
b

Bao Le Duc

06/30/2022, 8:41 AM
trying…
no luck, I got the same errors
r

ribesg

06/30/2022, 8:47 AM
Well then unless there’s some caching, that’s not your issue
b

Bao Le Duc

06/30/2022, 8:48 AM
I did
gradlew clean
before building, so shouldn’t be a cache issue
Thank @ribesg
k

Kevin Henriksson

06/30/2022, 11:07 AM
having the same issue but with x64
🥲 1
j

Jeff Lockhart

06/30/2022, 4:49 PM
Is the module name different than the pod name? I found this can sometimes be the case. When importing the module in Swift, what's the module name you use?
Try changing to
pod("AgoraRtcEngine_iOS", moduleName="TheModuleName")
, where "TheModuleName" is something different than the pod name.
3 Views