dehy/react-native-radio-player

Fails to build on Xcode 12.5

chrise86 opened this issue · 2 comments

Recently got this on an existing RN 0.63.2 project and could replicate on a fresh RN 0.64.5 project:

Undefined symbols for architecture x86_64:
  "Swift._ArrayBuffer._copyContents(initializing: Swift.UnsafeMutableBufferPointer<A>) -> (Swift.IndexingIterator<Swift._ArrayBuffer<A>>, Swift.Int)", referenced from:
      generic specialization <serialized, Swift._ArrayBuffer<Swift.Int8>> of Swift._copyCollectionToContiguousArray<A where A: Swift.Collection>(A) -> Swift.ContiguousArray<A.Element> in libFRadioPlayer.a(Reachability.o)
  "__swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers", referenced from:
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_FRadioPlayer in libFRadioPlayer.a(FRadioPlayer.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_FRadioPlayer in libFRadioPlayer.a(FRadioAPI.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_FRadioPlayer in libFRadioPlayer.a(Reachability.o)
      __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_react_native_radio_player in libreact-native-radio-player.a(RadioPlayer-563b97a1c1d7bbc04e4c7ea7d6eb4466af44ab7c655dc0f57fb4e303b0123046.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_FRadioPlayer, __swift_FORCE_LOAD_$_swiftUniformTypeIdentifiers_$_react_native_radio_player )
  "__swift_FORCE_LOAD_$_swiftCoreMIDI", referenced from:
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_FRadioPlayer in libFRadioPlayer.a(FRadioPlayer.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_FRadioPlayer in libFRadioPlayer.a(FRadioAPI.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_FRadioPlayer in libFRadioPlayer.a(Reachability.o)
      __swift_FORCE_LOAD_$_swiftCoreMIDI_$_react_native_radio_player in libreact-native-radio-player.a(RadioPlayer-563b97a1c1d7bbc04e4c7ea7d6eb4466af44ab7c655dc0f57fb4e303b0123046.o)
     (maybe you meant: __swift_FORCE_LOAD_$_swiftCoreMIDI_$_react_native_radio_player, __swift_FORCE_LOAD_$_swiftCoreMIDI_$_FRadioPlayer )
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

So the solution is removing references to $(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME) as explained here facebook/react-native#31179 (comment).

Not sure why adding this to the project forces the need to do this.

dehy commented

Strange. I specifically updated the library to v0.2.3 to compile against Xcode 12.5. I will try again to see the solution you mention.