LoginSignup
5

More than 5 years have passed since last update.

【Swift】Test時のエラー対処 (随時追記予定)

Posted at

■ Spec

Xcode: version 7.0.1
Swift: version 2.0
Cocoapods: version 0.39.0
 


◇ ライブラリのimportがarchitectureの問題でエラーになる

 → podsプロジェクトの BuildActiveArchitectureOnlyYES になっていないか確かめる
  ※pod install 実行後にYESに戻ってしまうので注意
 ①Podsプロジェクトを選択
 ②プロジェクトを選択
 ③BuildSettingsを表示
 ④[ Build Active Architecture Only ]を検索し、値を NO にする
 ⑤再度ビルドしてみる
 スクリーンショット 2015-10-28 17.17.48.png
 
 


◇ buildした @testable 対象のプロジェクトが cannot import module being compiled swift エラーになる

スクリーンショット 2015-10-28 17.07.11.png

 → TestTargetの ProductNameBuildTarget のものと一緒になっていないか確認。
 → Frameworkなどと名前が被っていないか確認。
 ①プロジェクトを選択
 ②TestTargetを選択
 ③BuildSettingsを表示
 ④[ product ]を検索し、ProductNameの項目をCheck
 ⑤BuildTargetと同じ名前だったり、frameworkと名前がかぶっていたら修正
  ※ $(TARGET_NAME) にしたらだいたい改善します

スクリーンショット 2015-10-28 17.05.18.png

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
5