1

Is it possible on android to programmatically initialize firebase-crashlytics SDK so it would not use the data in google-services.json ?

I am asking this because we use two firebase projects and currently google-services.json is of the project we use for Push notifications and AdMob integration, and I cannot replace it with google-services.json of the second project we have set up for crashlytics.

I have already tried using FirebaseOptions from my Application onCreate as follows:

 FirebaseOptions options = new FirebaseOptions.Builder()
                .setApplicationId("firebase_crashlytics_application_id")
                .setApiKey("firebase_crashlytics_api_key")
                .setProjectId("firebase_crashlytics_project_id")
                .build();
 FirebaseApp.initializeApp(this, options, "crashlytics");

So far no luck - firebase crashlytics is not properly initialized.

drorsun
  • 881
  • 1
  • 8
  • 22
  • Related https://stackoverflow.com/q/62253691/1916449 https://stackoverflow.com/q/64373296/1916449 https://stackoverflow.com/q/53831792/1916449 – arekolek Nov 12 '20 at 09:18

2 Answers2

3

I got an official answer from google support - we cannot programmatically initialize firebase crashlytics. I.e. it requires having the google services file related to the project you want to see the craslytics data for.

Therefore we would have to use a single firebase project somehow for all firebase services including admob and push.

drorsun
  • 881
  • 1
  • 8
  • 22
1

Great question. You can set this up by following these steps.

Todd Burner
  • 2,202
  • 12
  • 15
  • sadly this did not help. as the data in the link implies you can configure multiple google services per flavour (which is not what I need) or you can programmatically set additional project as I already tried - but this does not work crashlytics – drorsun Feb 23 '20 at 08:50