Firebase Crashlytics无效api KEY AndroidX Gradle 3

问题描述 投票:3回答:2

像许多人一样,我无法使用Firebase Crashlytics添加我的应用程序。我遵循了official documentation的所有步骤。

此外,我之前检查并将我的应用程序添加到Firebase,一切正常。

我的问题如下:

ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: null. 
Check the Crashlytics plugin to make sure that the application has been added successfully! 
Contact [email protected] for assistance.

我正确设置了google-services.json文件。从官方文档中,它现在应该可以正常工作而无需其他任何操作。

编辑 - 解决方案

就像我在评论中所说,我发现了这个问题。这是因为我使用的是Gradle版本。我移动我的项目以支持AndroidX,我使用的是3.3+的最新版本,但是在这个版本中,google-services.json文件在构建阶段没有被解析。它通过3.2+版本解决。

来自Firebase团队,只有稳定版本正在运行。

android firebase crashlytics
2个回答
2
投票

您的项目是否构建为支持即时应用程序(即您有基本功能模块,可安装模块和即时应用程序模块)?我在最后一天半处理这个确切的错误,最后为我修复的是将crashlytics { instantAppSupport true }添加到我的基本功能模块的gradle文件的底部。如果您是为即时应用程序构建的,这可能值得一试。


0
投票

您确定在其中一个文件中添加了Crashlytics API密钥吗?

AndroidManifest.xml中:

<meta-data
    android:name="io.fabric.ApiKey"
    android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxx" />

面料属性:

# Fabric properties file: app/fabric.properties
apiSecret=xxxxxxxxxxxxxxxxxxxxxxxxxxx
apiKey=xxxxxxxxxxxxxxxxxxxxxxxxxxx
© www.soinside.com 2019 - 2024. All rights reserved.