How can I fix this CrashlyticsMissingDependencyException?
Asked Answered
V

17

103

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)
Verticillaster answered 8/2, 2015 at 15:9 Comment(3)
As mentioned in the answers below, we're working on a fix, but using 1.14.4 will work while we continue to get to the bottom of this.Jacey
I just try to uninstall and install the Fabrics for Android Studio couples time. AS need to restart couple time to get his sanity back.Educate
use this link docs.fabric.io/android/crashlytics/…Demodulate
P
21

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'
Porker answered 9/2, 2015 at 17:47 Comment(1)
Here are the versions available: s3.amazonaws.com/fabric-artifacts/public/io/fabric/tools/gradle/…Canto
M
95

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.

Macdonell answered 18/2, 2015 at 7:33 Comment(8)
I'm getting the same issue with 1.20.1 and 2.5.2@aar. But I can't use this workaround on CI as the build workspace is reset for every build :(Percale
@HieuRocker that's probably because the project was built on terminal and fabric.properties wasn't created?Noahnoak
@ThuyTrinh nope, fabric.properties is therePercale
@HieuRocker did u manage to fix that? it seems the Fabric Gradle plugin didn't recognize the fabric.properties. building just worked fine on the IDE having the Fabric plugin installed. this really sucks and is haunting us on both terminal and CI server!Noahnoak
I'm working with the engineers at Fabric. Different timezones suck and it took us almost 2 weeks already. Still no solution yet. But you can try a workaround on the CI: ./gradlew clean assemble , then ./gradlew assemble, the apk generated by the second command will work as normal.Percale
@ThuyTrinh turned out it's because of dataBinding = true. Crashlytics has rolled out a fix for it: twittercommunity.com/t/…Percale
Updated fabric plugin today and got this error. Workaround helps, but it not works on subsequent runs. So I have to comment this line for run.Feint
Its not working for me in com.crashlytics.sdk.android:crashlytics:2.6.8@aarMf
O
27

I had this commented out in gradle

apply plugin: 'io.fabric'

needed to uncomment it

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

Officeholder answered 8/4, 2016 at 16:44 Comment(0)
P
21

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'
Porker answered 9/2, 2015 at 17:47 Comment(1)
Here are the versions available: s3.amazonaws.com/fabric-artifacts/public/io/fabric/tools/gradle/…Canto
J
14

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.+'
Juliojulis answered 9/2, 2015 at 18:18 Comment(0)
T
13

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" />
Tetracaine answered 9/7, 2015 at 4:53 Comment(2)
Their integration guidelines seemed outdated. Seemingly no longer need fabric.properties but a <meta-data android:name="io.fabric.ApiKey" android:value="YOUR_API_KEY"/> in the AM file. The name was changed from "com.crashlytics.ApiKey" to "io.fabric.ApiKey".Noahnoak
Yes, you'r right. It's important. I updated my post. Thank you.Tetracaine
P
13

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

Polarimeter answered 7/7, 2016 at 8:43 Comment(0)
J
10

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.

Jacey answered 10/2, 2015 at 19:43 Comment(18)
I'm not using Fabric integration by only Crashlytics itself and I'm also getting CrashlyticsMissingDependencyException. How could I deal with it?Tooth
@Tooth can you include part of your build.gradle?Jacey
@MikeB After some time, again I'm getting CrashlyticsMissingDependencyException. I'm using: dependencies { classpath 'com.android.tools.build:gradle:1.2.3' classpath 'com.crashlytics.tools.gradle:crashlytics-gradle:1.16.0' } and compile 'com.crashlytics.android:crashlytics:1.1.13'Tooth
Hmm, very odd @bogumil. Does running refresh-dependencies help?Jacey
@MikeB It doesn't help. I sent also an email to support@ and I can deliver more details if necessary.Tooth
@MikeB, thanks for the great work you and the team do on Fabric! I just posted an answer below that you might be interested in reviewing. Maybe I had an unusual case, but then again, maybe it will help your team or someone else.Principally
Thanks for sharing your additional answer @DavidM that should have happened during the upgrade flow, but glad you're all set. For reference, for others - see the steps here - dev.twitter.com/fabric/android/integratingJacey
Thanks Ankit, please send me a note at suppor(at)fabric(dot)io, I'll need more information to help out.Jacey
@MikeB sent you from [email protected]Nicotinism
This bug is back, we are experiencing it in io.fabric.tools:gradle:1.19.2Aldora
An app I installed days ago worked fine, today I bootup the device and start the app and get this CrashlyticsMissingDependencyException. Crashlytics/Fabric is proving to be a PITA Mike.Clarence
Attempts to rebuild project yield 'Crashlytics Developer Tools error'.Clarence
@MikeB which channel do u guys announce latest release of Fabric for Gradle?Noahnoak
Release notes can always be found here: docs.fabric.io/android/changelog.htmlJacey
I'm still seeing the issue on io.fabric.tools:gradle:1.20.1Onanism
It seems to be a combination of io.fabric.tools:gradle:1.20.1 and com.android.tools.build:gradle:1.5.0 with dataBinding enabledOnanism
@MikeBonnell I just registered to read the details of the fix, but the page is no longer public.Immobilize
What page isn't available?Jacey
K
5

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);
Kreager answered 24/1, 2017 at 18:1 Comment(0)
R
5

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;

Robena answered 5/6, 2017 at 9:22 Comment(0)
P
4

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

Percale answered 4/12, 2015 at 17:9 Comment(1)
Great point - this is a more recent version of that error. Using 1.21.0 or 1.21.1 will help.Jacey
L
3

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!

Lindemann answered 23/6, 2017 at 6:1 Comment(0)
M
1

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.

Maybellemayberry answered 11/6, 2017 at 10:33 Comment(0)
P
0

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'
Principally answered 29/6, 2015 at 17:48 Comment(0)
T
0

Check if crashlytics is disabled in build.gradle file

    debug {
        ext.enableCrashlytics = false
    }

Instead use

    debug {
        ext.enableCrashlytics = true
    }
Tunnage answered 26/4, 2017 at 10:9 Comment(0)
N
0

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.

Nolde answered 11/5, 2017 at 4:35 Comment(0)
I
0

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?!

Immobilize answered 2/11, 2018 at 15:16 Comment(0)
G
-1
<meta-data
    android:name="firebase_crashlytics_collection_enabled"
    android:value="false" /> 

Add that to in AndroidManifest.xml.

Gyron answered 26/12, 2018 at 11:51 Comment(1)
So your solution to fixing the problem is to disable Crashlytics completely?Winther

© 2022 - 2024 — McMap. All rights reserved.