How can I fix this CrashlyticsMissingDependencyException?

AndroidCrashlyticsTwitter Fabric

Android Problem Overview


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/FabricThis 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/AndroidRuntimeFATAL 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)

Android Solutions


Solution 1 - Android

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.

Solution 2 - Android

I had this commented out in gradle

apply plugin: 'io.fabric'

needed to uncomment it

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

Solution 3 - Android

The only workaround for now, if you really need to publish your app, is to change the dynamic version numbers to static ones:

[...]

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

[...]

compile('com.crashlytics.sdk.android:crashlytics:2.2.0@aar') {
        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.26.1'

Solution 4 - Android

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.+'

Solution 5 - Android

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" />

Solution 6 - Android

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{}}

Solution 7 - Android

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.

Solution 8 - Android

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

Solution 9 - Android

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;

Solution 10 - Android

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

Solution 11 - Android

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!

Solution 12 - Android

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.

Solution 13 - Android

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'

Solution 14 - Android

Check if crashlytics is disabled in build.gradle file

    debug {
        ext.enableCrashlytics = false
    }

Instead use

    debug {
        ext.enableCrashlytics = true
    }

Solution 15 - Android

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.

Solution 16 - Android

Removing the application icon fixed Crashylitics, whaaat?

I had everything done based on the onboarding tutorial, using the latest versions, etc.

Just wasted an hour trying to figure this out. It turns out someone thought it was a good idea to read the package name of the application icon instead of context.packageName to get the application's resources given a context. It's done in this method:

io.fabric.sdk.android.services.common.CommonUtils#getResourcePackageName

This obviously blows up if you happen to use an icon that's not inside the APK, for example: android:icon="@android:drawable/sym_def_app_icon". It probably was a good idea at the time, wonder what weird bug they were trying to work around?!

Solution 17 - Android

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

Add that to in AndroidManifest.xml.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionxialinView Question on Stackoverflow
Solution 1 - Androidi906View Answer on Stackoverflow
Solution 2 - AndroidMobileMonView Answer on Stackoverflow
Solution 3 - Androidgw0View Answer on Stackoverflow
Solution 4 - AndroidKhaleesiView Answer on Stackoverflow
Solution 5 - AndroidSergei KView Answer on Stackoverflow
Solution 6 - AndroidSidhanth SurView Answer on Stackoverflow
Solution 7 - AndroidMike BonnellView Answer on Stackoverflow
Solution 8 - AndroidDamir MailybayevView Answer on Stackoverflow
Solution 9 - AndroidnmwView Answer on Stackoverflow
Solution 10 - AndroidHieu RockerView Answer on Stackoverflow
Solution 11 - AndroidRahul RastogiView Answer on Stackoverflow
Solution 12 - AndroidyyunikovView Answer on Stackoverflow
Solution 13 - AndroidDavid MView Answer on Stackoverflow
Solution 14 - AndroidSagarView Answer on Stackoverflow
Solution 15 - AndroidKumar UtkarshView Answer on Stackoverflow
Solution 16 - AndroidTWiStErRobView Answer on Stackoverflow
Solution 17 - AndroidDholakiya MadhuriView Answer on Stackoverflow