问题
I have a project that has been using Crashytics for a while. Today, I added a new build type by copying/pasting one of the existing blocks under buildTypes{...} and renaming it.
The build type includes a different application id suffix, so I logged into the Firebase console, registered a new app using the new application id suffix, and downloaded the generated google-services.json file and placed it in a src folder with the same name as the build type.
Attempts to build the new variant fail with the message:
Execution failed for task ':app:uploadCrashlyticsMappingFileR1Qa'.
java.io.IOException: com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id
The other variants build without issue. I have tried gradle sync, cleaning and rebuilding, as well as invalidating cache and restarting Android Studio. But the error persists.
I've searched for Crashlytics Org Id, but can find no mention of it in the documentation, or the wider internet, save a couple other SO posts that do not shed much light.
What is Crashlytics Org Id, and from where is it retrieved?
UPDATE: It seems that Google is trying to be a little too automagical here. After adding the google-services.json file to your project, literally need to open up the Crashlytics section of your Firebase console, left-click the next steps (including the step that just opens the documentation) until it says "build and run your app" and do that with the console open. I'm in that habit of right-clicking links and opening them in other tabs/windows and apparently this does not trigger a necessary script on that page.
回答1:
I got this error when Crashlytics
was not completely configured in Firebase Console
Make sure that you have added your new build type as separate app in console and then go to Crashlytics
section select new app and complete all three steps there.
After this build again, build should succeed.
回答2:
try to check again your plugin in gradle, I think you forgot to add some plugins
回答3:
Make sure that you have added your app in the firebase project settings with the correct package name and that you have downloaded the google-services.json
file and put it into the app.
- Open Firebase Console
- Select your project
- In the left menu next to
Project Overview
you can navigate to theProject settings
. - Use the
Add app
button or check the existing package name for the app. - Download
google-services.json
and put into your project.
来源:https://stackoverflow.com/questions/60084952/new-build-type-fails-with-error-crashlyticsorgidexception-could-not-fetch-cras