8

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

Ankit
  • 3,878
  • 5
  • 35
  • 51

2 Answers2

3

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"

Iain Wilson
  • 357
  • 3
  • 2
  • 3
    It isn't really a solution, because each time you'll run pod install it will be replaced, or where did you add it? – melbic Oct 01 '15 at 16:39
  • As @melbic said this shouldn't be a permanent solution. Only a bypass for the moment to unblock you. Ankit you should not mark this as the final solution – Carlos Ricardo Oct 13 '15 at 14:07
  • Yes, this is just a workaround - ideally I'd figure out what's causing the header conflict and resolve it, but for now to allow the project to build I have this in my Podfile to keep the workaround when running pod install: ```post_install { `find Pods/ReactiveCocoa -type f ! -name EXTRuntimeExtensions.m -exec sed -i '' 's/import "EXTRuntimeExtensions.h"/import "..\\/Objective-C\\/extobjc\\/EXTRuntimeExtensions.h"/g' {} \\;` }``` (Paths might differ depending on the exact commit of ReactiveCocoa) – Iain Wilson Oct 13 '15 at 14:52
  • 1
    I get linker error with this approach: ```Undefined symbols for architecture x86_64: "_mtl_executeCleanupBlock", referenced from: -[NSObject(RACKVOWrapper) rac_observeKeyPath:options:observer:block:] in NSObject+RACKVOWrapper.o ___84-[NSObject(RACPropertySubscribing) rac_valuesAndChangesForKeyPath:options:observer:]_block_invoke in NSObject+RACPropertySubscribing.o ___84-[NSObject(RACPropertySubscribing) rac_valuesAndChangesForKeyPath:options:observer:]_block_invoke39 in NSObject+RACPropertySubscribing.o ld: symbol(s) not found for architecture x86_64``` – orkenstein Nov 28 '15 at 09:15
1

As an option you can set ReactiveCocoa version less then 3.0.0. For example, version 2.5 is normally working with Mantle.

pod 'Mantle', "~> 2.0.2"
pod 'ReactiveCocoa', "~> 2.5"
Denis
  • 519
  • 2
  • 5
  • 12