Okay I have tried all above solution and failed.
After a while I found that my Project has 2 modules and I call firebase in the second module instead of the main one, so the solution is to add the second one to the firebase project too, and it works.