Skip to content

fix(ios): x86_64 simulator build fails on Xcode 26 due to ffi_call target type mismatch #47

Description

@skrtdev

Summary

iOS simulator builds targeting x86_64 fail on Xcode 26 when compiling NativeApiJsiInvocation.h in the NativeScript FFI layer.

Error

NativeApiJsiInvocation.h:485:5: error: no matching function for call to 'ffi_call'
NativeApiJsiInvocation.h:480:5: error: cannot initialize a variable of type 'void *' with an rvalue of type 'void (*)()'

Observed with iPhoneSimulator26.4.sdk (EAS / CI and local Xcode 26 builds).

Cause

In the __x86_64__ branch of callObjCSelector, the Objective-C message send function is stored in a void* variable before being passed to ffi_call:

void* target = dispatchSuperClass != Nil
                   ? (isStret ? FFI_FN(objc_msgSendSuper_stret) : FFI_FN(objc_msgSendSuper))
                   : (isStret ? FFI_FN(objc_msgSend_stret) : FFI_FN(objc_msgSend));
ffi_call(&signature->cif, target, returnStorage.data(), values.data());

FFI_FN() expands to ((void (*)(void))f), but ffi_call expects its second argument to be void (*)(void), not void*. Older Clang accepted the implicit conversion; Xcode 26’s Clang rejects it.

The non-x86_64 branch already passes FFI_FN(...) directly and compiles fine.

Proposed fix

Change the variable type to match ffi_call’s signature:

-    void* target = dispatchSuperClass != Nil
+    void (*target)(void) = dispatchSuperClass != Nil

File: NativeScript/ffi/shared/jsi/NativeApiJsiInvocation.h (around line 480).

Environment

  • Xcode 26 / iPhoneSimulator26.4.sdk
  • Architecture: x86_64 (Intel simulator)
  • Package: @nativescript/react-native (published from this repo)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions