LoginSignup
4
3

More than 5 years have passed since last update.

Objective-Cプロジェクトにswift対応して出たコンパイルエラー Duplicate interface definition for class の解決方法

Last updated at Posted at 2016-10-04

CocoaPodsで管理している古いObjective-Cに初めてSwiftを入れる時に以下のような謎のエラーが大量に出ました。

Duplicate interface definition for class 'PMKPromise'
・・・
Redefinition of 'PMKCatchPolicy'

PromiseKitを入れているのですが、重複するようなコードはありません。

色々試してみた結果、importに問題がありました。

- #import "PromiseKit.h"
+ #import <PromiseKit/PromiseKit.h>

もちろんPromiseKit以外のフレームワークでも同様にimportしないとコンパイルエラーが出ます。

これに気づくのに時間がかかったので、誰かの役に立てれば。

4
3
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
4
3