Alexander Larsson
04/20/2020, 8:22 AMFoundation
. The cinterop
task fails with an exception:
> Task :shared:cinteropObjektiveSSLIos FAILED
1 actionable task: 1 executed
Exception in thread "main" java.lang.Error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:492:1: error: expected identifier or '('
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1003)
at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:992)
at org.jetbrains.kotlin.native.interop.indexer.NativeIndexKt.buildNativeIndex(NativeIndex.kt:91)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:230)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:46)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:44)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:37)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':shared:cinteropObjektiveSSLIos'.
> Process 'command '/Applications/IntelliJ IDEA <http://CE.app/Contents/jbr/Contents/Home/bin/java|CE.app/Contents/jbr/Contents/Home/bin/java>'' finished with non-zero exit value 1
Line 492 in NSObjCRuntime.h is:
@class NSString, Protocol;
Is this a bug in Kotlin/Native or the cinterop
tool?
I can remove the import of Foundation
to "fix" this bug but then it fails with error: unknown type name 'NSData'
so I obviously need to keep it in there.
Any workarounds?Alexander Larsson
04/20/2020, 8:36 AMlanguage = Objective-C
in the .def
file. Is this documented anywhere? In that case I haven't found it 😅Alexander Larsson
04/20/2020, 8:45 AMArtyom Degtyarev [JB]
04/20/2020, 9:16 AMcinterop
always assume input files as plain C headers.