Skip to content
Advertisement

Message: Call to private method KreaitFirebaseServiceAccount::fromJsonFile() from context ‘Firebase’

Does this error have anything to do with the Firebase version? If not, how do I solve this issue?

JavaScript

Advertisement

Answer

The code you posted is from kreait/firebase-php and shows a private method from the ServiceAccount class that can not be called directly since release 5.0 of the SDK.

Straight from the troubleshooting section in the documentation:

You probably followed a tutorial article or video targeted at a 4.x version, and your code looks like this:

JavaScript

Change it to the following:

JavaScript
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement