React-native-firebase: Crashlytics found an invalid API key: null

Created on 16 Apr 2018  路  11Comments  路  Source: invertase/react-native-firebase

Hi, I am getting a Crashlyitcs error.

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.

I followed instructions on rnfirebase.io to implement it. Could someone please help me?

Crashlytics Waiting for User Response

Most helpful comment

In my case I had this line missing at the bottom of app/build.gradle

apply plugin: 'com.google.gms.google-services'

All 11 comments

@thevishnupradeep were you using Crashlytics previously? Or is this a new project?

Can you send your app/build.gradle? I'm guessing you are using the wrong version of Crashlytics...

Actually it was some weird error that came up when I added crashlytics before firebase itself. I am not completely sure what caused it. I made a new project and added all dependencies manually and all worked ok.

I am having the same issues, any idea how to remedy this without creating a new project

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
            name 'Google' // maybe delete this
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        // Add jitpack repository (added by react-native-spinkit)
        maven { url "https://jitpack.io" }
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

ext {
    buildToolsVersion = "26.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}

In my case I had this line missing at the bottom of app/build.gradle

apply plugin: 'com.google.gms.google-services'

I am having the same issues, any idea how to remedy this without creating a new project

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.fabric.io/public'
            name 'Google' // maybe delete this
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        // Add jitpack repository (added by react-native-spinkit)
        maven { url "https://jitpack.io" }
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
}

ext {
    buildToolsVersion = "26.0.3"
    minSdkVersion = 16
    compileSdkVersion = 26
    targetSdkVersion = 26
    supportLibVersion = "26.1.0"
}

That's messes up, but the only thing that worked for me too was to create a new project, fisrt step adding firebase, second step adding all other dependencies

I think the error is in project.gradle... I explain about it, this dependencie is correct because is inside the project.gradle:

classpath 'com.google.gms:google-services:3.0.0'
The other dependencie that needs firebase, needs is inside app.gradle:

apply plugin: 'com.google.gms.google-services'
And the app.gradle needs too this dependence:

compile 'com.google.firebase:firebase-core:9.6.1'
The finally gradles are these, project.gradle:

buildscript {
repositories {
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.android.tools.build:gradle:2.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

}
}

allprojects {
repositories {
jcenter()
mavenLocal()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
And the app.gradle:

...

dependencies {
compile 'com.google.android.gms:play-services:9.6.1'
compile 'com.google.firebase:firebase-core:9.6.1'
}

//At final of the document
apply plugin: 'com.google.gms.google-services'
Tell me if I can helps you, greetings!

upgrade to
classpath 'com.google.gms:google-services:4.2.0'

it works for me

android/build.gradle
classpath 'com.google.gms:google-services:4.3.3'

android/app/build.gradle
apply plugin: 'com.google.gms.google-services'

@Baskerville42 4.3.3 is current and if you don't use it or higher you'll be open for irritating google version check errors

@mikehardy sorry, that my fault
on my project, I'm using the newest version, but for my comment, I just copied string from another comment :)
you're absolutely right about version warnings/errors

Was this page helpful?
0 / 5 - 0 ratings