【Swift/Carthage】Error:「Could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-ios」の解決方法!

この記事からわかること

  • Swift/Carthageライブラリ導入時に発生したエラー解決法
  • ErrorCould not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-ios"原因
  • ライブラリ読み込めない

index

[open]

\ アプリをリリースしました /

みんなの誕生日

友達や家族の誕生日をメモ!通知も届く-みんなの誕生日-

posted withアプリーチ

環境

Could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-ios

Carthageを使用してライブラリを導入する流れの中でエラーが発生しました。

【Swift】Carthageの導入と使い方!ライブラリ管理ツール

発生したのはXcode内でプロジェクトディレクトリ内の「Carthageディレクトリ」>「Build」>「iOS」>「ライブラリ.frameworkディレクトリ」を選択します。

【Swift】Carthageの導入と使い方!ライブラリ管理ツール

さらにこの後の「Run Script」と「Input Files」にも追記し終えてライブラリの導入が完了したと思い、ビルドしようとした際でした。

発生したエラー

Could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-ios

エラーの原因

Could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-iosビルド時に導入したライブラリがシミュレーター用のアーキテクチャ「arm64-apple-ios-simulator」に対応していないために発生する可能性があるようです。


Could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-ios

解決方法

私の場合は「Excluded Architectures」に「arm64 ×86_64」を加えることで解決することができました。

解決方法

Xcodeの「Build Settings」>「Excluded Architectures」から「Debug」と「Release」両方に「Any iOS Simulator SDK」:「arm64 ×86_64」を加えます。本来なら「arm64」のみで良いですが、その後に「×86_64」もないよというエラーが出たので両方とも書いています。

【Swift/Carthage】Error:「Could not find module 'Alamofire' for target 'arm64-apple-ios-simulator'; found: arm64-apple-ios」の解決方法!

「Excluded Architectures」はビルド時に除外するアーキテクチャを記入する箇所です。

ご覧いただきありがとうございました。

searchbox

スポンサー

ProFile

ame

趣味:読書,プログラミング学習,サイト制作,ブログ

IT嫌いを克服するためにITパスを取得しようと勉強してからサイト制作が趣味に変わりました笑
今はCMSを使わずこのサイトを完全自作でサイト運営中〜

New Article

index