I'm making an app in my spare time and I wanted to ask you a question, my workspace has 3 subprojects: presentation, domain and data, each one is a static framework and has its own pods, and all very cool, but now I have a problem that I don't know how to solve it. I have several firebase dependencies that some of them must be in Presentation and others in Data, the problem comes when executing because it gives me an error :
Class PodsDummy_FirebaseUI is implemented in both /Users/.../Debug-iphonesimulator/PresentationCleanExample.framework/PresentationCleanExample (0x104ffada0) and /Users/.../data/Containers/Bundle/Application/A15FF8B8-7B67-4512-8DFD-04F008175660/CleanExample.app/CleanExample (0x100c6e288). One of the two will be used. Which one is undefined.
So what I've see in the podspec of FirebaseUI/Storage is the following: https://github.com/firebase/FirebaseUI-iOS/blob/master/FirebaseStorageUI.podspec
s.dependency 'Firebase/Storage'
s.dependency 'GTMSessionFetcher/Core', '~> 1.5.0'
s.dependency 'SDWebImage', '~> 5.6'
This makes me think that cocoapods is not resolving the dependency Firebase/Storage properly.
And the problem is that this is only one of the thousands of duplicate classes that I have from Firebase for following the diagram above. I suppose there is a way to inject the Firebase dependency only once and thus avoid class duplication, but I don't know how.
My Podfile:
platform :ios, '13.6'
workspace 'CleanExample'
use_frameworks!
def firebase_pods
pod 'Firebase/Core', '7.11.0'
pod 'Firebase/Auth', '7.11.0'
pod 'Firebase/Firestore', '7.11.0'
pod 'Firebase/Storage', '7.11.0'
pod 'FirebaseFirestoreSwift', '7.11.0-beta'
end
target 'CleanExample' do
project 'CleanExample'
firebase_pods
pod 'FirebaseUI/Storage'
end
target 'PresentationCleanExample' do
project 'PresentationCleanExample/PresentationCleanExample.xcodeproj'
# firebase_pods
pod 'FirebaseUI/Storage'
end
target 'DomainCleanExample' do
project 'DomainCleanExample/DomainCleanExample.xcodeproj'
end
target 'DataCleanExample' do
project 'DataCleanExample/DataCleanExample.xcodeproj'
firebase_pods
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
end
end
end
Github
I've uploaded the code https://github.com/rchampa/CleanExample
Questions
Is there something wrong with the FirebaseStorageUI.podspec file or is a limitation of cocoapods?
Is my Podfile wrong?