I am trying to add Firebase crashlytics to our project but just can not get it to work.
I have followed the instructions adding the necessary lines to our gradle file but no success so far.
The main issue I get is this message: Crashlytics found an invalid API key: null
which seems weird since I thought an API key should not be needed for Firebase.
I use Android studio 3.0.1 with the latest gradle plugin. My project is Ionic based but I have tried to hand modify the gradle file as well with the same results.
I had a similar problem and it turned out that I did not apply google-services plugin in the bottom of build.gradle (in app module)
apply plugin: 'com.google.gms.google-services'
After that it is working
There is an incompatibility with some other Firebase libraries that add the API key in the manifest for you, for example com.firebaseui:firebase-ui-auth:2.3.0
You can check with the Merged Manifest in Android Studio, to see if that is the case:
The issue might be resolve by updating/removing the library if possible, otherwise you can remove the API key by adding a <meta-data>
tag with a tools:node="remove"
attribute, like this:
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="your.package">
<application
...>
<meta-data
android:name="io.fabric.ApiKey"
tools:node="remove"/>
</application>
</manifest>
This will tell the manifest merger that you don't want this specific meta-data.
# Fabric properties file: app/fabric.properties
apiSecret=x8x6x5x54x4xx8xxxx98 #your api hash
apiKey=xx389xxx8xx7x787x8x7x78x78x9x #api key
if you added api key in manifest remove it
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.