LoginSignup
2
2

More than 3 years have passed since last update.

【Swift】@testable import no such module “xxx” というエラーが出る

Posted at

Xcodeでユニットテストを実行しようとしたらタイトルのエラーが出てしまった。
そんなモジュールは存在しないよと怒られてます。

:tools: TestのTargetの「Host Application」が設定されていない

スクリーンショット 2020-05-21 16.11.08.png

上記の、タブ画面でHostApplicationが「None」になっていないか確かめる。
もしなっていたたら現在自分が開発中のアプリをターゲットにしてあげる。

:computer: プロジェクト名などを途中で変更した場合

テストファイル内の

@testable import test

上記でいう「test」の部分は自動で更新されない。。
ので自分で修正してあげる必要がある。

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