Hello everyone, My name is Dandy. I use macos 15,...
# getting-started
đ
Hello everyone, My name is Dandy. I use macos 15, with xcode 16, and iphoneos18.0 sdk I build ios project use KMM and KMM compose. How can i fix it? I got this log:
Copy code
Exception in thread "main" java.lang.Error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/usr/include/copyfile.h:35:10: fatal error: 'sys/cdefs.h' file not found
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:75:10: fatal error: could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/usr/include/dispatch/dispatch.h:28:10: fatal error: could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/usr/include/os/object.h:28:10: fatal error: could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/usr/include/objc/objc-auto.h:36:10: fatal error: could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/usr/include/os/workgroup_base.h:15:10: fatal error: could not build module 'Darwin'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:10: fatal error: could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/System/Library/Frameworks/Security.framework/Headers/SecBase.h:28:10: fatal error: could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h:18:10: fatal error: could not build module 'CoreFoundation'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS18.0.sdk/usr/include/xpc/xpc.h:6:10: fatal error: could not build module 'os_object'
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(
)

at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(
)

at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(
)

at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(
)

at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(
)

at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.access$processCLibSafe(
)

at org.jetbrains.kotlin.native.interop.gen.jvm.Interop.interop(
)

at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(
)

at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(
)

at org.jetbrains.kotlin.cli.utilities.MainKt.main(
)
🧵 1
s
I wonder if you're trying to mix code from different architectures (e.g. i386/arm64)
The bit you need to Google for is probably the "'sys/cdefs.h' file not found" part
If you include your OS in your search query I think you'll find suggestions from others with similar issues
đ
But, if i open xcode, i see it. I dont know why KMM give this log.
I mean, with if xcode i can see the lib. But when i run build, it failed and log libs not found.
p
Maybe xcode16 is not fully supported? Saw it on the roadmap today: Support Xcode 16 in Kotlin
👀 1
đ
Thanks @phteven
Thank you all, I have solved the problem.
a
hey @Đỗ Thành Đạt how did you solve it? 😅
g
yes, how? I have exactly same error
okay I figured it out. Kotlin version should be minimum 2.0.21
👍 1
317 Views