gomobile init
gomobile bind -target=ios,iossimulator -x -o My.xcframework
And I get following error, probably because following API is not available at iOS.
<path>/watcher_fsevents_cgo.go:172:9: could not determine kind of name for C.EventStreamCreate
<path>/watcher_fsevents_cgo.go:171:9: could not determine kind of name for C.FSEventStreamContext
<path>/watcher_fsevents_cgo.go:40:12: could not determine kind of name for C.FSEventStreamCreateFlags
<path>/watcher_fsevents_cgo.go:87:27: could not determine kind of name for C.FSEventStreamEventFlags
<path>/watcher_fsevents_cgo.go:88:27: could not determine kind of name for C.FSEventStreamEventId
<path>/watcher_fsevents_cgo.go:178:3: could not determine kind of name for C.FSEventStreamInvalidate
<path>/watcher_fsevents_cgo.go:35:15: could not determine kind of name for C.FSEventStreamRef
<path>/watcher_fsevents_cgo.go:176:2: could not determine kind of name for C.FSEventStreamScheduleWithRunLoop
<path>/watcher_fsevents_cgo.go:177:5: could not determine kind of name for C.FSEventStreamStart
<path>/watcher_fsevents_cgo.go:192:2: could not determine kind of name for C.FSEventStreamStop
<path>/watcher_fsevents_cgo.go:41:19: could not determine kind of name for C.FSEventsGetCurrentEventId
<path>/watcher_fsevents_cgo.go:40:39: could not determine kind of name for C.kFSEventStreamCreateFlagFileEvents
<path>/watcher_fsevents_cgo.go:40:78: could not determine kind of name for C.kFSEventStreamCreateFlagNoDefer
cgo:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang errors for preamble:
<path>/watcher_fsevents_cgo.go:17:8: error: unknown type name 'FSEventStreamRef'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
^
<path>/watcher_fsevents_cgo.go:17:43: error: unknown type name 'FSEventStreamContext'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
^
<path>/watcher_fsevents_cgo.go:17:109: error: unknown type name 'FSEventStreamEventId'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
^
<path>/watcher_fsevents_cgo.go:17:161: error: unknown type name 'FSEventStreamCreateFlags'
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
^
<path>/watcher_fsevents_cgo.go:19:9: error: call to undeclared function 'FSEventStreamCreate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
^
<path>/watcher_fsevents_cgo.go:19:9: note: did you mean 'EventStreamCreate'?
<path>/watcher_fsevents_cgo.go:17:25: note: 'EventStreamCreate' declared here
static FSEventStreamRef EventStreamCreate(FSEventStreamContext * context, uintptr_t info, CFArrayRef paths, FSEventStreamEventId since, CFTimeInterval latency, FSEventStreamCreateFlags flags) {
^
<path>/watcher_fsevents_cgo.go:19:36: error: use of undeclared identifier 'FSEventStreamCallback'; did you mean 'FSEventStreamCreate'?
return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
^~~~~~~~~~~~~~~~~~~~~
FSEventStreamCreate
<path>/watcher_fsevents_cgo.go:19:9: note: 'FSEventStreamCreate' declared here
return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
^
<path>/watcher_fsevents_cgo.go:19:59: error: expected ')'
return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
^
<path>/watcher_fsevents_cgo.go:19:28: note: to match this '('
return FSEventStreamCreate(NULL, (FSEventStreamCallback) gostream, context, paths, since, latency, flags);
^
7 errors generated.
I am trying to compile the package with
gomobilefor ios platformAnd I get following error, probably because following API is not available at iOS.