New build type fails with error: CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id

六月ゝ 毕业季﹏ 提交于 2020-02-24 07:05:08

问题


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.

  1. Open Firebase Console
  2. Select your project
  3. In the left menu next to Project Overview you can navigate to the Project settings.
  4. Use the Add app button or check the existing package name for the app.
  5. 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

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