I’m having an issue with CocoaPod integration.
I have created a new KMM project from Android Studio “New Project/KMM Application”
Then added a basic CocoaPod dependency on AFNetworking just as described in the tutorial
https://kotlinlang.org/docs/native-cocoapods.html#add-a-dependency-on-a-pod-library-from-the-cocoapods-repository
Then I have updated Platform class with AFNetworking usage.
import platform.UIKit.UIDevice
import cocoapods.AFNetworking.*
actual class Platform actual constructor() {
actual val platform: String = UIDevice.currentDevice.systemName() + " " + UIDevice.currentDevice.systemVersion +
" " + AFNetworkingReachabilityNotificationStatusItem
}
After that I’m getting linkage error while trying to build an iOS app.
Undefined symbols for architecture x86_64:
"_AFNetworkingReachabilityNotificationStatusItem", referenced from:
_cocoapods_AFNetworking_AFNetworkingReachabilityNotificationStatusItem_getter_wrapper12 in shared(result.o)
ld: symbol(s) not found for architecture x86_64
How to solve this error?
My configuration
Android Studio Arctic Fox 2020.3.1 Patch 3
Kotlin 1.6.0
XCode 13
ruby 2.6.0p0 (had to downgrade because of a problem with cocoapods-generate install)
cocoapods 1.11.2
cocoapods-generate 2.2.2
Mac OS Monterey 12.0.1