52

I saw all other questions, but none of accepted answers is working for me.

By following integration steps found here https://dev.twitter.com/twitter-kit/android/integrate I have created crashlytics.properties file in module root. File is filled with apiKey and apiSecret values found in my newly created twitter application.

Error occurr on project build. I am using AndroidStudio 1.0

This is my error:

ERROR - Crashlytics Developer Tools error.
java.lang.IllegalArgumentException: Crashlytics found an invalid API key: REAL_APIKEY_VALUE. 
Check the Crashlytics plugin to make sure that the application has been added successfully! 
Contact support@fabric.io for assistance.
Andy Piper
  • 11,422
  • 2
  • 26
  • 49
bajicdusko
  • 1,630
  • 1
  • 17
  • 32

9 Answers9

60

You just forgot to add one line, in app-level gradle file.

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

this happens because when you are adding firebase:crashlytics, firebase document not have this line. so you need to add it manually. see this is firebase:crashlytics document photo.Check This Image

Prashant Gosai
  • 1,186
  • 1
  • 10
  • 18
46

This happened to me when I updated Android Studio from 3.2 to 3.3, to fix it I just updated the

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

to

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

And it worked again

VikaS GuttE
  • 1,636
  • 2
  • 14
  • 38
29

Works fine added this on fabric.properties like this:

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

Add on .gitignore (for open source projects)

REMOVE entry on AndroidManifest.xml:

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

Oficial documentation: https://docs.fabric.io/android/fabric/settings/working-in-teams.html

Hpsaturn
  • 2,702
  • 31
  • 38
  • I am going to trust you and accept this answer. After this question, I have integrated Crashlytics numerous times with usage of Fabric plugin in Android Studio and it works as expected. So I would suggest the same to you. In my opinion that should be the only and right way to do integration. – bajicdusko Nov 18 '16 at 08:05
  • 1
    right now the two ways are valid implementations. But for continuous integration, it implementation is only way. The basic config from plugin works fine, but for CI and OpenSource projects we need it – Hpsaturn Nov 21 '16 at 16:16
  • The Android plugin didn't work for me. Also, in iOS had to manually add the pods as the app didn't recognize that the project uses CocoaPods (I opened the workspace file). – Tapani Oct 23 '17 at 05:26
  • what if my project is using firebase? as fabric is merged with firebase – Kishan Oza Jun 20 '19 at 10:36
17

I also experienced this issue and it took a while for me to realize I forgot adding the following line into the app/build.gradle:

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

After adding it, it started working like a charm even without <meta-data> in manifest and/or app/fabric.properties file.

Pei
  • 11,452
  • 5
  • 41
  • 45
9

Add the below line in app/build.gradle file

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

Clean The Project and Run.

Biswajit Panday
  • 817
  • 10
  • 20
6

after adding file fabric.properties, getting error as below.

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.

We need to register app and verify SHA-1 for same. Add firebase: add google-services.json file from firebase console to your /app folder of your application.(follow steps given by Firebase Console-> Add Firebase to your Android app ) It's not giving error now

Pradip Tilala
  • 1,715
  • 16
  • 24
0
<meta-data android:name="com.crashlytics.ApiKey" 
           android:value="YOUR_API_KEY"/>

Add this one on Android manifest.xml here you get the api key https://www.fabric.io/kits/android/crashlytics/install

0

If someone is using crashlytics with Android dynamic features module, make sure your fabric and google-services plugins are applied only in your app module. In my case that was the problem.

Paweł Dedio
  • 1,338
  • 12
  • 20
0

Changing the below dependency at project build.gradle from :

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

to

classpath "com.google.gms:google-services:4.2.0"

has solved the problem for me.

rajkabbur
  • 187
  • 3