react-native-fast-tflite icon indicating copy to clipboard operation
react-native-fast-tflite copied to clipboard

iOS does not build on x86 Simulators

Open mrousavy opened this issue 1 year ago • 6 comments

On iOS, we currently build TensorFlowLiteC from source. This builds a fat iOS binary: https://github.com/mrousavy/react-native-fast-tflite/blob/5b8d61270e777dd5b66bbe06004e5109bac8f874/scripts/build-tensorflow-ios.sh#L16-L17

..for some reason users have reported that this does not work when running the app on an iOS Simulator on a Intel x86 Mac.

I don't have such Mac anymore, but I am not sure what's going wrong - maybe there is a way to also build for x86?

mrousavy avatar Jan 31 '24 15:01 mrousavy

Hey thanks for this project!

I am seeing a similar build failure on an M2 (pro) mac as well that seems related and separately I have an Intel based mac (i9) and it is able to build for an IOS simulator just fine. I can build for physical device no problem on both.

here's the error message from the build on an iPhone 15 Pro Max simulator on the M2 mac; perhaps there is a caching issue?

Building for iOS Simulator, but linking in object file built for iOS, file '/Users/XXX/Repos/notewize-player/node_modules/react-native-fast-tflite/ios/TensorFlowLiteC.framework/TensorFlowLiteC' for architecture arm64

I can paste up more of the build log if that is helpful!

I'm happy to help debug if you can give me any pointers as to where to start or look.

eedeebee avatar Mar 07 '24 18:03 eedeebee

Honestly not sure why this is failing, might be interesting to see if TFLite works for Simulators or if they have some patches for that.

mrousavy avatar Mar 07 '24 20:03 mrousavy

I got similar error as follow ld: building for 'iOS-simulator', but linking in object file (/Users/XXX/rn-test/node_modules/react-native-fast-tflite/ios/TensorFlowLiteC.framework/TensorFlowLiteC) built for 'iOS'

movila avatar Mar 14 '24 02:03 movila

Me too Building for 'iOS-simulator', but linking in object file (.../node_modules/react-native-fast-tflite/ios/TensorFlowLiteC.framework/TensorFlowLiteC) built for 'iOS'

stereodenis avatar Jul 05 '24 07:07 stereodenis

Solved my adding arm64 and this to podFile 👇🏻 target.build_configurations.each do |config| config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'i386 arm64' end end

xcode_screenshot

hydromoll avatar Jul 05 '24 10:07 hydromoll

Honestly not sure why this is failing, might be interesting to see if TFLite works for Simulators or if they have some patches for that.

@mrousavy there are issues with iOS Simulators it seems, #74

lucksp avatar Jul 13 '24 20:07 lucksp