Unable to get provider com.crashlytics.android.CrashlyticsInitProvider

不打扰是莪最后的温柔 提交于 2019-12-03 05:39:19

This helped to solve my problem

<meta-data
            android:name="firebase_crashlytics_collection_enabled"
            android:value="false" />

And remove this:

<meta-data android:name="firebase_crash_collection_enabled" android:value="false" />

I found that the only thing you need to do after following the instruction on the Firebase Crashlytics docs is to apply the fabric plugin in your app build file (This step is actually missing from the docs!).

In your app-level build.gradle add the following

// Apply the Fabric plugin
apply plugin: 'io.fabric'

Edit: It appears that this step has been recently added to the docs (See Step 2 / part 2).

I ran into this issue as well it was caused by using the incorrect Fabric.with() initializer for debug builds.

Don’t use:

// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder()
        .core(new CrashlyticsCore.Builder()
                .disabled(BuildConfig.DEBUG)
                .build())
        .build();

// Initialize Fabric with the debug-disabled Crashlytics
Fabric.with(this, crashlyticsKit, new Crashlytics()); // WRONG!

Instead use:

// Set up Crashlytics, disabled for debug builds
Crashlytics crashlyticsKit = new Crashlytics.Builder()
        .core(new CrashlyticsCore.Builder()
                .disabled(BuildConfig.DEBUG)
                .build())
        .build();

// Initialize Fabric with the debug-disabled Crashlytics
Fabric.with(this, crashlyticsKit); // Correct initializer!

Documentation: https://docs.fabric.io/android/crashlytics/build-tools.html#disable-crashlytics-for-debug-builds

If you are going to use other Firebase's API's, I'd suggest to setup crashlytics
As mentioned on Firebase's crashlytics page, here.

And obviously before that you'd need to setup firebase for your app
and create project through firebase console.
I believe you had already done that.

It's because I see small difference in crashlytics setup on these two pages(fabric and firebase).
like on firebase's crashlytics:
in app level gradle

dependencies {
    // ...
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.3'
}

on fabric:

dependencies {
    // ...
      implementation('com.crashlytics.sdk.android:crashlytics:2.9.4@aar') {
    transitive = true;
  }
}

You won't need to add fabric api key through manifest if you are using with firebase, I think it somehow get connected with firebase key(just guessing).
I'm saying this from my experience, anyone correct me if I'm somewhere wrong.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!