3

I currently have 2 deployable frameworks. Same app, two faces: Client and Vendor.

Most of the data-model classes and some views are completely identical. So I've created another framework named "Common". I had no problem using Common as a dependency for Client and Vendor frameworks until Firebase and Crashlytics appeared.

I have some code that again, would be identical in both frameworks. So Common is the way I wanted to go. But, when using Cocoapods, there will be two definitions of those libraries, Xcode log says Class <<SomeFirebaseClass>> is implemented in both <<LONG CLIENT PATH>> and <<LONG COMMON PATH>>. One of the two will be used. Which one is undefined. and this issue occurs.

My Pod File:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
workspace 'Application'
use_frameworks!

# ignore all warnings from all pods
inhibit_all_warnings!

abstract_target 'CommonPods' do
  pod 'ChameleonFramework/Swift'
  pod 'Fabric'
  pod 'Crashlytics'
  pod 'Alamofire', '~> 4.5'
  pod 'SwiftyJSON'
  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  target 'Attendant' do
    project 'Attendant/Attendant'
  end
  target 'Client' do
    project 'Client/Client'
  end
end

I've found some issues in the CocoaPods's repository somehow related but no fix so far.

My question here is: How can I accomplish this? And if I can't, what is the best way to achieve something close to this?

Vitor Hugo Schwaab
  • 1,545
  • 20
  • 31

0 Answers0