0

I am trying to install the Firebase Performance SDK and following their instructions on the site:

https://firebase.google.com/docs/perf-mon/get-started-ios

When I run the pod install step it gives me the following error:

firebase performance required by podfile

I run the pod update command and everything runs on the pod install but then when I open up my workspace I get errors in swift as such:

  • FIRDatabaseReference has been renamed to DatabaseReference
  • FIRDatabase has been renamed to Database
  • FIRFirebase.database().reference is now Database.database.reference

which then give the error

  • Database has no member reference

What gives!? Has anyone gotten these error after updating their podfile with Firebase!?

Pod file is as such:

# Uncomment this line to define a global platform for your project
 platform :ios, '9.0'

target 'Pool' do
    # Uncommnet this line if you're using Swift
    use_frameworks!

    #Pods for firebase pool
    pod 'Firebase', '>=2.5.1' <--- This has been removed from the podfile as suggested 
    pod 'Firebase/Core'
    pod 'Firebase/Performance'
    pod 'Firebase/Auth'
    pod 'Firebase/Database'
    pod 'Firebase/Storage'
    pod 'Firebase/Crash'

    target 'PoolTests' do
     # inherit! :search_paths
    end


    target 'PoolUITests' do
     # inherit! :search_paths
    end

end

Result of pod install enter image description here

Error in xcode after pod install/update: enter image description here

Keith Simmons
  • 293
  • 1
  • 7
Learn2Code
  • 1,974
  • 5
  • 24
  • 46

2 Answers2

2

Here's a guide for upgrading Firebase iOS: https://firebase.google.com/support/guides/firebase-ios

With 4.0 in particular, the Swift interfaces have been cleaned up to make it more "Swifty" which is why you're seeing those rename warning.

After the renaming, accessing the database reference should look like:

let ref:DatabaseReference = Database.database().reference()

For the updated docs of the new swift interface, see here: https://firebase.google.com/docs/reference/ios/firebasedatabase/api/reference/Classes/FIRDatabase

Eric Shieh
  • 697
  • 5
  • 11
  • it throws an error with let ref:DatabaseReference = Database.database().reference().... first one is to remove the () on the database() function and once you do that it throws the Database has no member reference error!? – Learn2Code May 19 '17 at 19:38
  • "Database" might be conflicting with another class in your app. You might need to use the fully qualified type name. Try: let ref:DatabaseReference = FirebaseDatabase.Database.database().reference() – Eric Shieh May 20 '17 at 13:40
0

The release of Firebase 4.0 on May 17 has the changed the naming convention and can be found in this naming migration guide:

https://firebase.google.com/docs/reference/ios/naming-migration-guide

iosforme
  • 25
  • 1
  • 10