Greetings, I’m trying to add a CocoaPod dependenc...
# multiplatform
e
Greetings, I’m trying to add a CocoaPod dependency to my project. As a starting point, I used the examples in https://github.com/Kotlin/kmm-with-cocoapods-sample. However, I’m getting “Failed to generate cinterop” for all the dependent CocoaPods. Is this a known issue with generating cinterop, or is there something broken with my Xcode config? The actual error looks like:
Copy code
> Task :kotlin-library:cinteropPod_dependencyIosArm64
Exception in thread "main" java.lang.Error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:615:74: error: unknown type name 'NSUInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:615:104: error: unknown type name 'NSUInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:631:24: error: unknown type name 'NSInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:631:24: error: unknown type name 'NSInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:639:20: error: unknown type name 'NSUInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:639:20: error: unknown type name 'NSUInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:644:20: error: unknown type name 'NSUInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:644:20: error: unknown type name 'NSUInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:649:17: error: unknown type name 'NSInteger'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:649:17: error: unknown type name 'NSInteger'
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:80)
	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:15)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:564)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:307)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:243)
k
Do you use latest Kotlin and Xcode versions?
e
Thanks. Just figured that out myself. To answer my own question, the issue seems to be resolved by updating to 1.9.23 (I’m not ready to jump to 2.0).
👌 1