22

I had this bug after updated from com.google.gms:google-services:4.0.1 to com.google.gms:google-services:4.1.0

Crashlytics found an invalid API key: null. 
Check the Crashlytics plugin to make sure that the application has been added successfully! 
Contact support@fabric.io for assistance.

For Java projects, they hadn't this problem. I tried to invalidate cache and restart but not resolve.

I'm using: Android Studio 3.3 Canary 8

dependencies {
      classpath 'com.android.tools.build:gradle:3.3.0-alpha08'

      classpath 'com.google.gms:google-services:4.1.0'
      classpath 'io.fabric.tools:gradle:1.25.4'

      classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.61"
      classpath "org.jetbrains.kotlin:kotlin-android-extensions:1.2.61"
}

FirebaseCrashlytics version:

implementation 'com.google.firebase:firebase-core:16.0.3'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'

Thanks!

Rahul Khatri
  • 1,502
  • 2
  • 13
  • 25
kimcy
  • 331
  • 3
  • 7
  • 1
    Did you find any solution? I'm having exactly the same problem (altough mine is a java project). – Granjero Sep 14 '18 at 12:17
  • Having the exact same problem just now. Used the connect button in the Firebase connect tool and that one didn't work either. – ZeroStatic Sep 14 '18 at 12:23
  • 1
    @Granjero I don't know too. I just only updated the old version and java project is good. I think we should use the old version 4.0.1 for now. I reported the problem on issues tracker. Maybe, they will check again. [link](https://issuetracker.google.com/issues/113821952) – kimcy Sep 15 '18 at 02:06
  • I am also facing the same issue. As of now continued using the old version. – Mohit Charadva Sep 27 '18 at 21:25
  • 1
    I think this issue will soon be getting a lot more attention. The upgrade to 4.1.0 is also causing 'Default FirebaseApp is not initialized in this process com.example.app. Make sure to call FirebaseApp.initializeApp(Context) first' run error, addressed in another thread. Developers are also being forced to go back to 4.0.1 for that. – Androidcoder Oct 04 '18 at 19:13
  • The one non-auto response I got from repeated attempts to support@fabric.io the error directs you to was that Fabric and Crashlytics are separate teams so they couldn't help me. – Androidcoder Oct 05 '18 at 18:41
  • 3
    Currently, they updated google service plugin 4.2.0 and seems it works again. You should try. – kimcy Oct 28 '18 at 03:00

5 Answers5

0

Try adding this to manifest

<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-xxxxxx~xxxxxx"/>

See my related answer to Default FirebaseApp is not initialized for more details.

Androidcoder
  • 4,389
  • 5
  • 35
  • 50
0

Try adding following dependency

implementation 'com.google.firebase:firebase-crash:16.2.1'
Mohammedsalim Shivani
  • 1,793
  • 3
  • 19
  • 30
0

In my case, the error was produced because I was picking the wrong APK file. You should pick the debug apk (app-debug.apk) instead of the app-name.apk.

FedeH
  • 1,343
  • 18
  • 24
0

You need to add the meta data for the fabric in AndroidManifest.xml

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

Be guided that the best way is stated below:

Add the Fabric API key to your fabric.properties: apiKey=fabric_api_key

# Fabric properties file: app/fabric.properties
apiSecret=xx68f6074dxxxxxc11dxxx97c172e8ebf0
apiKey=xxxe75b4xxxx97e8cxxxx0135e9d46f5a2xxx

Official documentation

Yusuf Adefolahan
  • 312
  • 2
  • 11
0

update google plugin from

classpath 'com.google.gms:google-services:4.1.0'

to

classpath 'com.google.gms:google-services:4.2.0'
Marium Jawed
  • 391
  • 4
  • 9