简体   繁体   中英

How to use Using Firebase SDKs from static frameworks in Cocoa pods

I am trying to update Firebase version SDK in the project, but cause Firebase SDKs was used in pos as dynamic frameworks, as cause it is by different targets inside the app, it cause app to crash. After reading : Morgan Chen answer

Firebase page

How to organise pod file to make it work properly?

inhibit_all_warnings!

use_frameworks!(:linkage => :static)

platform :ios, '10.0'

workspace 'MainProject'

project 'someSDK/someSDK.xcodeproj' project 'MainProject/MainProject.xcodeproj'

def common_pods

pod 'AFNetworking'

use_frameworks! :linkage => :static
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'

end

target :someSDKPresentation do
use_frameworks! :linkage => :static pod 'Firebase/Core' pod 'Firebase/Crashlytics' pod 'Firebase/Analytics'

pod 'AFNetworking'

project 'someSDK/someSDK.xcodeproj'

end

target :someSDKCommon do

pod 'GoogleAnalytics'
pod 'AFNetworking'

use_frameworks! :linkage => :static
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'

project 'someSDK/someSDK.xcodeproj'

end

target :MainProject do common_pods pod 'GoogleSignIn' pod 'TwitterKit'

project 'MainProject/MainProject.xcodeproj'

end

target :MainProjectDev do common_pods pod 'GoogleSignIn' pod 'TwitterKit'

project 'MainProject/MainProject.xcodeproj'

end

Thanks in advance!

The only one proper solution in my case was to add whole Firebase libraries that I need. I lookes like this: 静态库

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM