简体   繁体   中英

Crashlytics found an invalid API key: @string/twitter_consumer_secret, when mofing from Crashreporting to Crashlytics in Firebase

I am in the process of migrating from firebase crash reporting to Firebase Crashlytics (as we have to until 9th September), following the guides here https://firebase.google.com/docs/crashlytics/upgrade-from-crash-reporting and double checked I have no left over I followed the guide here https://firebase.google.com/docs/crashlytics/get-started?authuser=0

I also searched around quiet a while, and found some similar questions, but no answer helped, or they are too old to apply, because they are pre Firebase versions.

when i do a "build/clean" in Android Studio, I get the following error

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

So I searched for the 'twitter_consumer_secret' in my whole project and for the word "twitter". The only spot it is found, is the generated Android Manifest in the build path.

So I assume Crashlytics complains, because it does not find a valid key there.

But why is this 'twitter_consumer_secret' generated there ?

I have the following in the dependency's section

implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.google.gms:google-services:4.1.0'
apply plugin: 'com.google.gms.google-services' // at the end of the gradle file
apply plugin: 'io.fabric' // at top of the gradle file after 'com.android.application'

I really hoped to get this done today, so any help is more then welcome.

To add: If I only remove the

apply plugin: 'io.fabric'

the error goes away, but Crashlytics does not seem to work.

It looks like the issue is in com.google.gms . Use version 4.0.1 instead of 4.1.0 :

android/build.gradle

buildscript {
    ...
    dependencies {
        ...
        classpath 'com.google.gms:google-services:4.0.1'
    }
}

It should solve the issue.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM