Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods: duplicate interface definition

I' wrapped my private library into CocoaPods. It has dependency on ReactiveCocoa.

s.name =  'MineLibrary'
s.dependency 'ReactiveCocoa/Core'
s.source_files = 'Source/*.{h,m,swift}'
....

Some header files contain:

#import <ReactiveCocoa/RACSignal.h>

I include it in a new project:

use_frameworks!
....
pod 'ReactiveCocoa'
pod 'MineLibrary', :git => 'git@.....'

But when I compile the project, I'm getting this error:

duplicate interface definition for class 'RACStream'
duplicate interface definition for class 'RACSignal'


/Users/USER/Library/Developer/Xcode/DerivedData/Project-emcwpmbbuimotuftzijeemvngrvj/Build/Products/Debug-iphoneos/Pods/ReactiveCocoa.framework/Headers/RACStream.h:27:1: error: duplicate interface definition for class 'RACStream'

@interface RACStream : NSObject
^
/Users/USER/Workspace/Project/Pods/ReactiveCocoa/ReactiveCocoa/RACStream.h:27:12: note: previous definition is here
@interface RACStream : NSObject

How can it be solved?
P.S. I'm using CocoaPods 0.36.0.rc.1

like image 456
Mikhail Avatar asked Feb 26 '15 15:02

Mikhail


1 Answers

I was having this issue a while back, somebody imported a cocoapod header incorrectly. Make sure you use bracket notation, E.G. rather than: #import "theUsefulClass.h" you should be using: #import <thePod/theUsefulClass.h>

like image 185
Jangles Avatar answered Oct 12 '22 13:10

Jangles