react-native-health icon indicating copy to clipboard operation
react-native-health copied to clipboard

Build fails with error "Duplicate symbols for architecture x86_64" under Xcode

Open dimitris4 opened this issue 3 years ago • 2 comments

I'm using the react-native-health and the react-native-ble-manager libraries in the same project. The problem is that both libraries have a property called hasListeners, which causes the error "Duplicate symbols for architecture x86_64" under Xcode. I can fix it by setting 'NO COMMON BLOCKS' to NO inside XCode -> Pods, but I was wondering whether the names of these properties can be changed in the original places so they don't cause conflicts.

dimitris4 avatar Feb 09 '22 07:02 dimitris4

I have the same error with same packages.

❌  duplicate symbol '_hasListeners' in
> libRNAppleHealthKit.a(RCTAppleHealthKit.o)
> libreact-native-ble-manager.a(BleManager.o)

❌  ld: 1 duplicate symbol for architecture x86_64

❌  clang: error: linker command failed with exit code 1 (use -v to see invocation)

I found another solution here: https://stackoverflow.com/questions/71500066/duplicate-symbol-haslisteners-react-native But this solution requires create a fork of react-native-health and change RCTAppleHealthKit.m

I hope for a correct fix

Ryabchikus avatar Dec 15 '22 13:12 Ryabchikus

Any updates ?

joZephhh avatar Feb 07 '23 08:02 joZephhh