Firebase Module install on ios

前端 未结 10 1447
囚心锁ツ
囚心锁ツ 2021-02-18 20:38

I followed all instructions for integrating the new firebase release on ios:

  1. I downloaded the file GoogleService-Info.plist

10条回答
  •  自闭症患者
    2021-02-18 21:00

    There are two ways of adding the Firebase SDK to your iOS project. You can either use CocoaPods, in which case its really important to make sure your pod dependency is in the target you are using. E.g.

    use_frameworks!
    platform :ios, '7.0'
    pod 'Firebase/Analytics'
    
    target 'Target1' do
    end
    target 'Target2' do
    end
    

    There are a lot of different ways of configuring targets in CocoaPods, so your Podfile may look different. The important thing is that the target you specify is linked with the pod - in this case I have specified the Analytics pod so its available to all targets, but if I put it just in the Target1 do...end block, then it wouldn't be available in Target2.

    If you're using the framework integration method, then make sure the libraries are specified in the Link Binary With Libraries section of your Build Phases tab. This should happen automatically if you drag them into a Frameworks group in Xcode.

    Finally, if that doesn't work, Xcode may have cached something bad. Try opening the Product menu, hold down Option and click Clean build folder.

提交回复
热议问题