LoginSignup
1
0

More than 1 year has passed since last update.

React Native 0.69 のバージョンアップで、RCT-Folly linker error: ld: -U and -bitcode_bundle cannot be used together というエラーになる。

Posted at

発生環境

React Native 0.69.4

原因

Issueが立っていました。
https://github.com/facebook/react-native/issues/34148

  • 詳細な原因までは理解できていませんが、Xcode 14ではBitcodeは廃止となるようです。
  • Reactの関連ライブラリがその対応に追随できていないものがあるのではないかと思われます。
  • 単にBitcodeをOFFにすると良い、ということなので、対応方法を記載します。

対応方法

Podfileに以下を記載します。

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

  post_install do |installer|
    # pods_projectとsubprojectの2箇所でENABLE_BITCODEをNOに設定
    installer.pods_project.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
    installer.pod_target_subprojects.each do |subproject|
      subproject.targets.each do |target|
        target.build_configurations.each do |config|
          config.build_settings['ENABLE_BITCODE'] = 'NO'
        end
      end
    end
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

参考

AppleがどうしてBitcodeを廃止するのか、については以下をご参照ください。

  • React Nativeではたくさんのライブラリを使用していますが、それらを直接修正することはできないので、Podfileで操作するということがわかりました。
  • 同様の事象で困っている方がおられたら、参考にいただければ幸いです。
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0