新的构建类型因错误而失败:CrashlyticsOrgIdException:无法获取Crashlytics组织ID [英] New build type fails with error: CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id

查看:448
本文介绍了新的构建类型因错误而失败:CrashlyticsOrgIdException:无法获取Crashlytics组织ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个项目已经使用Crashytics一段时间了。今天,我通过在buildTypes {...}下复制/粘贴现有​​块之一并重命名来添加新的构建类型。

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.

该构建类型包括一个不同的应用程序ID后缀,因此我登录到Firebase控制台,使用新的应用程序ID后缀注册了一个新应用程序,并下载了生成的google-services.json文件,并将其放置在与构建类型同名的src文件夹中。

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:


任务':app:uploadCrashlyticsMappingFileR1Qa'的执行失败。

Execution failed for task ':app:uploadCrashlyticsMappingFileR1Qa'.

java.io.IOException:com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException:无法获取Crashlytics组织ID

java.io.IOException: com.google.firebase.crashlytics.buildtools.exception.CrashlyticsOrgIdException: Could not fetch Crashlytics Org Id

其他版本的构建没有问题。我尝试了gradle同步,清理和重建,以及使缓存无效并重新启动Android Studio。但是错误仍然存​​在。

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.

我已经搜索了Crashlytics Org Id,但是在文档或更广泛的Internet中找不到它,请保存一些其他的SO帖子

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.

什么是Crashlytics Org ID,从哪里检索?

What is Crashlytics Org Id, and from where is it retrieved?

更新:看来Google试图成为一个这里有点太不可思议了。
在将google-services.json文件添加到您的项目后,实际上需要打开Firebase控制台的Crashlytics部分,左键单击下一步(包括仅打开文档的步骤),直到显示 ;构建并运行您的应用并在控制台打开的情况下进行操作。我习惯于右键单击链接并在其他选项卡/窗口中打开它们,显然这不会触发该页面上的必要脚本。

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.

推荐答案

Firebase控制台中没有完全配置 Crashlytics 时,出现此错误已在控制台中将您的新构建类型添加为单独的应用程序,然后转到 Crashlytics 部分,选择新应用程序并在那里完成所有三个步骤。

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.

这篇关于新的构建类型因错误而失败:CrashlyticsOrgIdException:无法获取Crashlytics组织ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆