问题
I just integrated the new Firebase SDK following these instructions: https://firebase.google.com/docs/crashlytics/get-started-new-sdk
It's working with debug builds, but I get this exception on release build:
java.io.IOException: com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id
Any idea?
回答1:
I was having the same error when trying to build a release APK, but it wasn't going away.
I realized that you need to generate at least one crash in Firebase Crashlytics before your Org Id becomes available.
After my first crash was visible in the Firebase Crashlytics Report page, release build started working.
So, make sure to follow the Firebase doc and run a test crash in debug before you try to build release.
回答2:
There seems to be a bug with the new firebase crashlytcs SDK where the Org Id is not generated unless the app is run with the firebase crashlytcs set up.
I followed the older sdk documentation which uses Fabric and ran the app with that. This is the older doc : https://firebase.google.com/docs/crashlytics/get-started?platform=android
Update to the new crashlytics SDK then and the project should build for you now. This is the new doc : https://firebase.google.com/docs/crashlytics/get-started-new-sdk?platform=android
回答3:
You need to go through all steps in Firebase web console in Crashlytics section until you'll see:
Build and run your app
We'll be listening for your app to communicate with our servers.
Then you can build an apk.
来源:https://stackoverflow.com/questions/59837528/build-failed-with-crashlyticsorgidexception