2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

M1 MacでReact NativeのFlipperのビルドがこける時

Last updated at Posted at 2020-12-10

2020/12/11追記: 実機(iPhone 11)で試してみたら動かなかったので、記述を追加


IwaiさんのM1 MacでのReact Native開発環境を整えるを読んで、だいたいビルドできるようになったのですが、Flipperのビルドがこけるのが気になっていました。

libFlipperKit.a, building for iOS Simulator-x86_64 but attempting to link with file built for iOS Simulator-arm64

こういう感じのエラーが出ます。ググってもさっぱりだったので、神頼みでPodfileに下記の記述を追加したところ通るようになりました。(###で始まるコメントの記述内容を追記)

  post_install do |installer|
    flipper_post_install(installer)

    installer.pods_project.build_configurations.each do |build_configuration|
      build_configuration.build_settings['ONLY_ACTIVE_ARCH'] = 'No'
      ### 次の行に`i386`を追加
      build_configuration.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64 i386"
      ### 次の行を追加
      build_configuration.build_settings["EXCLUDED_ARCHS"] = "armv7"
    end

    installer.aggregate_targets.each do |aggregate_target|
      aggregate_target.xcconfigs.each do |config_name, config_file|
        ### 次の行に`i386`を追加
        config_file.attributes['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] ='arm64 i386'
        ### 次の行を追加
        config_file.attributes['EXCLUDED_ARCHS'] ='armv7'
        config_file.save_as(aggregate_target.xcconfig_path(config_name))
      end
    end
  end

いずれ多分ちゃんとした対応方法が出てくると思うのですが、応急処置としては使えると思うので書いておきます。

2
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
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?