Reputation: 23
Java mavern application: When executing the following code firebaseCredential has stream exception cause set message with
"Failed to parse service account: 'project_id' must be set"
attached is the watch screen. NOTE: google-services.json file is downloaded in firebase console. Any help is appreciated.
Stacktrace:
FileInputStream serviceAccount = new FileInputStream("src/main/resources/google-services.json");
FirebaseCredential firebaseCredential = FirebaseCredentials.fromCertificate(serviceAccount); // FirebaseCredentials.applicationDefault();
FirebaseOptions options = new FirebaseOptions.Builder()
Upvotes: 2
Views: 510
Reputation: 418
You've downloaded the wrong credential Json file. Instead of getting the one in Project settings -> General, you should get it from Project settings -> Service Accounts and generate a new private key. It should generate for you a new Json file with the correct credentials in it.
Upvotes: 2