Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting error compiling ReactiveCocoa

I just pod installed this Podfile for a new project:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.0'

def import_pods
    pod 'Mantle'
    pod 'LBBlurredImage'
    pod 'TSMessages'
    pod 'ReactiveCocoa'
end

target 'WeatherJoy2' do
    import_pods
    link_with 'WeatherJoy2'
end

pod install succeeeded but now getting the following errors on building the project:

/Users/ankit/Documents/WeatherJoy2/Pods/ReactiveCocoa/ReactiveCocoa/NSObject+RACKVOWrapper.m:49:3: Unknown type name 'rac_propertyAttributes'; did you mean 'mtl_propertyAttributes'?
/Users/ankit/Documents/WeatherJoy2/Pods/ReactiveCocoa/ReactiveCocoa/NSObject+RACKVOWrapper.m:49:40: Implicit declaration of function 'rac_copyPropertyAttributes' is invalid in C99

/Users/ankit/Documents/WeatherJoy2/Pods/ReactiveCocoa/ReactiveCocoa/NSObject+RACKVOWrapper.m:49:27: Incompatible integer to pointer conversion initializing 'mtl_propertyAttributes *' with an expression of type 'int'

There is nothing else in the project, it was a new project. I'm on xcode 6.2 and OSX 10.9.5

like image 460
Ankit Avatar asked Jun 12 '15 19:06

Ankit


1 Answers

I had the same issue when using Mantle and ReactiveCocoa together. It appears to be caused by both pods having an EXTRuntimeExtensions.h header, which made ReactiveCocoa import the incompatible Mantle version of the header (with mtl_ vs rac_ function name prefixes).

In my case I fixed it by replacing each occurrence of #import "EXTRuntimeExtensions.h" in the ReactiveCocoa pod with #import "../Objective-C/extobjc/EXTRuntimeExtensions.h"

like image 57
Iain Wilson Avatar answered Oct 10 '22 22:10

Iain Wilson