Firebase Crashlytics Invalid Key Error

2019-06-26 02:51发布

问题:

I want to integrate Firebase Crashlytics into my Android game (developed using Cocos2D-X engine).

I have followed the steps mentioned in this link.

I'm getting following error when building the project using Android Studio:

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! 

It looks like that I am missing some API key. How can I find the Crashlytics API key in Firebase? How to mention that key in the Android project?

I would appreciate any suggestions and thought on this topic. Thank you.

回答1:

Rolling back to "com.google.gms:google-services:4.0.1" in my project build.gradle file fixed the problem for me.

The Firebase docs say to use version 4.1.0, which if you follow will give the error above.



回答2:

Please note the following things, this should solve your issue:

  1. Check Android Studio version, suggested version is 3.1.4.
  2. Classpath (project-level build.gradle file shouldn't have any alpha or beta versions. That is because Firebase only supports stable version of Android Studio.

That said, the recommended setup of your gradle version is:

classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:4.1.0'