Martin S
Martin S

Reputation: 386

CocoaPods RxCocoa 3.6.1 build failed in Xcode 9

RxCocoa version 3.6.1 fails to build in Xcode 9 with error message :

Initializer 'init(parentObject:)' with Objective-C selector   'initWithParentObject:' conflicts with initializer 'init(parentObject:)' from superclass 'RxScrollViewDelegateProxy' with the same Objective-C selector      

Upvotes: 0

Views: 142

Answers (1)

Martin S
Martin S

Reputation: 386

This seems to be caused by @objc inference. Strangely, turning off Swift 3 style @objc inference seems to fix it. Put this at the end of your Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['SWIFT_VERSION'] = '3.2'
      if target.name == 'RxCocoa' then
        config.build_settings['SWIFT_SWIFT3_OBJC_INFERENCE'] = 'Off'
      end
    end
  end
end

This sets all Pods to be build with Swift 3.2 a disables @objc inference for RxCocoa.

Upvotes: 2

Related Questions