Home » Android » CrashlyticsMissingDependencyException

CrashlyticsMissingDependencyException

Posted by: admin November 29, 2017 Leave a comment

Questions:

I have been using the latest Crashlytics (Fabric integration) for a while. But recently I encountered the following crash error due to missing dependency although I didn’t change anything about Crashlytics configurations.

any idea?

02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     |  |
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     |  |
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     |  |
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .   \ |  | /
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .    \    /
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     \  /
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .      \/
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
    install an Android build tool and ask a team member to invite you to this app's organization.
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .      /\
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     /  \
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .    /    \
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .   / |  | \
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     |  |
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     |  |
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .     |  |
02-08 22:18:00.935  18887-18887/? E/Fabric﹕ .
02-08 22:18:00.935  18887-18887/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    Process: com.example.android.staging, PID: 18887
    java.lang.RuntimeException: Unable to create application com.example.android.App: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.CrashlyticsMissingDependencyException:
    This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
    install an Android build tool and ask a team member to invite you to this app's organization.
            at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4734)
            at android.app.ActivityThread.access$1600(ActivityThread.java:171)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:157)
            at android.app.ActivityThread.main(ActivityThread.java:5506)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
            at dalvik.system.NativeStart.main(Native Method)
Answers:

The only workaround for now, if you really need to publish your app (like me), then change the dynamic version numbers to static ones:

[...]

classpath 'io.fabric.tools:gradle:1.14.4'

[...]

compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
        transitive = true
}

[...]

EDIT:

an updated version of the fabric sdk has been published, you can get it by changing the line to this:

classpath 'io.fabric.tools:gradle:1.15.2'

Questions:
Answers:

I have added the following codes before I actually installed Fabric/Crashlytics:

debug {
    ext.enableCrashlytics = false
}

Removing it before the first run with Crashlytics solved the problem. The problem no longer occurs after the first run.

Questions:
Answers:

Seems like specifying the plugin version as:


classpath 'io.fabric.tools:gradle:1.+'

picks up 1.15.1, which has the problem.

Specifying major and minor to previous 1.14 seems to be stable:


classpath 'io.fabric.tools:gradle:1.14.+'

Questions:
Answers:

I had same problem after update plugin.
to solve need remove from AndroidManifest.xml:

<meta-data
    android:name="com.crashlytics.ApiKey"
    android:value="API_SECRET_KEY" />

and add to fabric.properties:

apiSecret=API_SECRET_KEY
apiKey=YOUR_SECRET_KEY

UPDATE:

Now, you have to use:

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

Questions:
Answers:

Mike from Crashlytics here. We shipped an updated version – 1.15.2 – earlier today that includes a fix for this behavior. If you run:

./gradlew assemble --refresh-dependencies

that will pull in the latest version. You can also see more details on the fix here.

Questions:
Answers:

If you are using the disable function during debug as shown

 Crashlytics crashlyticsKit = new Crashlytics.Builder()
            .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
            .build();
    Fabric.with(this, crashlyticsKit);

What happens when you update the version of crashlytics is that

Fabric.with(this, crashlyticsKit); 

is turned to

Fabric.with(this,new Crashlytics());

So make sure to change that back to crashlyticskit. If you are doing this correctly and the error still appears then make sure you have

debug {
    ext.enableCrashlytics = false
}

under android {buildtypes{}}

Questions:
Answers:

I had this commented out in gradle

apply plugin: 'io.fabric'

needed to uncomment it

Or if you don’t have it, add it!

Questions:
Answers:

For me it was because of dataBinding = true. Upgrading the fabric gradle plugin to 1.21.0 fixed the issue: https://twittercommunity.com/t/fabric-gradle-plugin-1-21-0-add-support-for-android-databinding-true/57474

Questions:
Answers:

Fix for me
From official source

Disable Crashlytics for Debug Builds

If you don’t need Crashlytics crash reporting or beta distribution for debug builds, you can safely speed up your debug-builds by disabling the plugin entirely with these two steps:

First, add this to your app’s build.gradle:

android {
    buildTypes {
        debug {
          // Disable fabric build ID generation for debug builds
          ext.enableCrashlytics = false
          ...

Next, disable the Crashlytics kit at runtime. Otherwise, the Crashlytics kit will throw the following error:

com.crashlytics.android.core.CrashlyticsMissingDependencyException:

This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up`

You can disable the kit at runtime for debug builds only with the following code:

// 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);

Questions:
Answers:

The issue also occurs if you accidentally include the Crashlytics BuildConfig – very easy to do with Android Studio/IntelliJ auto-imports.

I’d imported

import com.crashlytics.android.core.BuildConfig;

Instead of my own

import <package_name>.BuildConfig;

Questions:
Answers:

In case this helps someone else, I had a similar issue when upgrading Crashlytics to Fabric. In my case, the plugin left 2 lines from Crashlytics that I needed to manually remove before it would work.

In the gradle file, under buildscript dependencies, I had to manually remove:

classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.16.0'

Also, under dependencies, I had to manually remove:

compile 'com.crashlytics.android:crashlytics:1.1.13'

Questions:
Answers:

May be I am late to reply.
But this can happen from one more reason apart from all the above answers

If you miss to add

apply plugin:'io.fabric'

This may seem strange but this will result in the same issue

This is by default added by fabric when we sign up and add code from the Fabric window Using IDE but accidentally it can be deleted.

Questions:
Answers:

Make sure to add apply plugin: 'io.fabric' into your application project build.gradle. In my case, I had a common build.gradle with apply plugin: 'io.fabric'. Moving it to application project solved the problem.

Questions:
Answers:

In my case, I was using fabric in a “CommonLib” module that was added as a dependency in all other modules (including app).
So, I had added apply plugin: 'io.fabric' after buildscript {} block. So, I placed two plugins together:

apply plugin: 'com.android.library' 
apply plugin: 'io.fabric'

And problem got solved!

Questions:
Answers:

Check if crashlytics is disabled in build.gradle file

    debug {
        ext.enableCrashlytics = false
    }

Instead use

    debug {
        ext.enableCrashlytics = true
    }