BabylonReactNative: building for iOS simulator

Hi there,
I’m able to successfully run a simple ReactNative app with Babylon on an iPhone, using the generated xcode project.

However, when I use the react native cli:

npx react-native run-ios

I get the following error:

ld: in /Users/olivier/Documents/BabylonReactNativeApp/node_modules/@babylonjs/react-native/ios/libs/libBabylonNative.a(BabylonNative.o), building for iOS Simulator, but linking in object file built for iOS, file ‘/Users/olivier/Documents/BabylonReactNativeApp/node_modules/@babylonjs/react-native/ios/libs/libBabylonNative.a’ for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

May be it’s not supported to build for the simulator?

Thanks!

cc @Cedric

AFAIK, binaries doesn’t contain x64 arch. Do you confirm @ryantrem ?
Are you using a mac m1 @obasille ?

1 Like

Yes M1, I should have mentioned that.
Thanks for the reply @Cedric!

1 Like

Is this any update on this? I am facing the same problem when I trying to use an M1 for compiling.

I got:

ld: in /Users/BabylonReactNative/node_modules/@babylonjs/react-native-iosandroid-0-70/ios/libs/libBabylonNative.a(BabylonNative.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/BabylonReactNative/node_modules/@babylonjs/react-native-iosandroid-0-70/ios/libs/libBabylonNative.a' for architecture arm64

Sorry for the delay. I don’t have an M1 that I can test but I think @srzerbetto did some ?

We have an issue for this here: Added IOS Simulator arm64 binaries to npm packages · Issue #451 · BabylonJS/BabylonReactNative (github.com)

Basically, the pre-built npm packages currently don’t support M1 iOS simulator.