logicappsource
logicappsource

Reputation: 39

Firebase 4.0 DatabaseReference Error

After migrating to Firebase 4.0 , I have this REALLY annoying issue with the Reference to the DB.*

"Cannot convert return expression of type 'DatabaseReference' to return type 'DatabaseReference'

Very frustating , I try to make a switch on a enum, to set multiple ref.

Even when I try to follow the new Docs.

enter image description here

Upvotes: 1

Views: 551

Answers (3)

Aaron Zhong
Aaron Zhong

Reputation: 1022

Alternative to @erdos's solution, if you want to keep you enum name then reference the module FirebaseDatabase:

FirebaseDatabase.DatabaseReference

Upvotes: 0

Catherine
Catherine

Reputation: 73

pod 'Firebase', '<4'
pod 'Firebase/Database', '<4'
pod 'Firebase/Auth', '<4'
pod 'Firebase/Storage'

Upvotes: 0

erdos
erdos

Reputation: 662

The compiler is getting confused with the Firebase class DatabaseReference and your enum of the same name DatabaseReference. Try using a different name for your enum.

Upvotes: 1

Related Questions