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

building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Posted at

TensorFlowLiteCを使うために色々としていた時に起きたエラーの話をします。

OSとしては、 M1 macを用いています。

エラー内容

会社の上司から、以下のリンクを読んで環境セッティングしといてと連絡が来たので環境セッティングをしていました。 https://pub.dev/packages/tflite_flutter

TensorFlowLiteCを使えるようにするには、以下のファイルの下にTensorFlowLiteC.frameworkを置くとのこと。
~/.pub-cache/hosted/pub.dartlang.org/tflite_flutter-<plugin-version>/ios/

実際に置いてから、Runをすると以下のエラーが発生。

building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

解決方法

`Ios`ファイル内にあるPodfile内にて、以下の一行を追加してから、`pod install`を行ってください。
post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    // 追加する一行
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

以下のサイトを参考にしました。
https://stackoverflow.com/questions/63607158/xcode-12-building-for-ios-simulator-but-linking-in-an-object-file-built-for-io

反省

このエラーが解消されるまでに、2時間ぐらいかかりました。 沢山のサイトを読みました。しかし、解決方法はとてもシンプルなもので、時間がかかった理由としては、一つのサイトを最後までしっかりと読んでいないことが理由だなと思いました。 なので、次からは最後までしっかりと読みきろうと思います。
0
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
0
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?