Android multiple firebase projects using firebase-crashlytics

本小妞迷上赌 提交于 2021-02-08 09:33:49

问题


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.


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/60266538/android-multiple-firebase-projects-using-firebase-crashlytics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!