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)
TylerH
  • 20,799
  • 66
  • 75
  • 101
xialin
  • 7,686
  • 9
  • 35
  • 66
  • 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. – Mike Bonnell Feb 09 '15 at 23:15
  • 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. – Robert Mar 07 '16 at 04:16
  • use this link https://docs.fabric.io/android/crashlytics/build-tools.html#disabling-crashlytics-for-debug-builds – Shervin Gharib May 17 '16 at 12:44

17 Answers17

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.

Danpe
  • 18,668
  • 21
  • 96
  • 131
i906
  • 1,677
  • 2
  • 16
  • 20
  • 2
    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 :( – Hieu Rocker Nov 27 '15 at 08:51
  • @HieuRocker that's probably because the project was built on terminal and fabric.properties wasn't created? – Thuy Trinh Dec 01 '15 at 18:17
  • @ThuyTrinh nope, fabric.properties is there – Hieu Rocker Dec 02 '15 at 00:31
  • @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! – Thuy Trinh Dec 03 '15 at 12:19
  • 1
    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. – Hieu Rocker Dec 03 '15 at 14:02
  • 3
    @ThuyTrinh turned out it's because of dataBinding = true. Crashlytics has rolled out a fix for it: https://twittercommunity.com/t/fabric-gradle-plugin-1-21-0-add-support-for-android-databinding-true/57474 – Hieu Rocker Dec 04 '15 at 17:08
  • 1
    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. – Ernest Poletaev Jan 08 '16 at 13:02
  • 1
    Its not working for me in `com.crashlytics.sdk.android:crashlytics:2.6.8@aar` – Tasneem Aug 02 '17 at 11:14
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!

MobileMon
  • 8,341
  • 5
  • 56
  • 75
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'
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.+'
TylerH
  • 20,799
  • 66
  • 75
  • 101
Khaleesi
  • 470
  • 3
  • 7
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" />
Sergei K
  • 967
  • 11
  • 12
  • 1
    Their integration guidelines seemed outdated. Seemingly no longer need fabric.properties but a `````` in the AM file. The name was changed from "com.crashlytics.ApiKey" to "io.fabric.ApiKey". – Thuy Trinh Dec 07 '15 at 10:46
  • 1
    Yes, you'r right. It's important. I updated my post. Thank you. – Sergei K Dec 08 '15 at 11:53
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{}}

Draken
  • 3,134
  • 13
  • 34
  • 54
Sidhanth Sur
  • 303
  • 2
  • 9
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.

Mike Bonnell
  • 16,181
  • 3
  • 61
  • 77
  • 1
    I'm not using Fabric integration by only Crashlytics itself and I'm also getting CrashlyticsMissingDependencyException. How could I deal with it? – bogumil Feb 10 '15 at 21:26
  • @bogumil can you include part of your build.gradle? – Mike Bonnell Feb 19 '15 at 02:29
  • 2
    @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' – bogumil May 20 '15 at 20:01
  • Hmm, very odd @bogumil. Does running refresh-dependencies help? – Mike Bonnell May 21 '15 at 20:22
  • @MikeB It doesn't help. I sent also an email to support@ and I can deliver more details if necessary. – bogumil May 22 '15 at 09:27
  • @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. – David M Jun 29 '15 at 17:50
  • 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 - https://dev.twitter.com/fabric/android/integrating – Mike Bonnell Jul 01 '15 at 12:56
  • Thanks Ankit, please send me a note at suppor(at)fabric(dot)io, I'll need more information to help out. – Mike Bonnell Jul 01 '15 at 19:23
  • @MikeB sent you from ankitgoyal1009@gmail.com – Ankit Jul 01 '15 at 19:27
  • This bug is back, we are experiencing it in io.fabric.tools:gradle:1.19.2 – Fabian Frank Sep 02 '15 at 23:58
  • 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. – straya Nov 05 '15 at 22:42
  • Attempts to rebuild project yield 'Crashlytics Developer Tools error'. – straya Nov 05 '15 at 23:09
  • @MikeB which channel do u guys announce latest release of Fabric for Gradle? – Thuy Trinh Dec 01 '15 at 09:12
  • Release notes can always be found here: https://docs.fabric.io/android/changelog.html – Mike Bonnell Dec 01 '15 at 14:13
  • I'm still seeing the issue on io.fabric.tools:gradle:1.20.1 – davehenry Dec 03 '15 at 04:58
  • 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 enabled – davehenry Dec 03 '15 at 06:45
  • @MikeBonnell I just registered to read the details of the fix, but the page is no longer public. – TWiStErRob Nov 02 '18 at 15:19
  • What page isn't available? – Mike Bonnell Nov 02 '18 at 17:34
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);
Damir Mailybayev
  • 1,031
  • 1
  • 9
  • 14
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;

nmw
  • 6,664
  • 3
  • 31
  • 32
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

Hieu Rocker
  • 1,070
  • 12
  • 19
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!

Rahul Rastogi
  • 4,486
  • 5
  • 32
  • 51
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.

yyunikov
  • 5,719
  • 2
  • 43
  • 78
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'
David M
  • 1,151
  • 12
  • 21
0

Check if crashlytics is disabled in build.gradle file

    debug {
        ext.enableCrashlytics = false
    }

Instead use

    debug {
        ext.enableCrashlytics = true
    }
Sagar
  • 39
  • 3
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.

Kumar Utkarsh
  • 161
  • 1
  • 8
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?!

TWiStErRob
  • 44,762
  • 26
  • 170
  • 254
-1
<meta-data
    android:name="firebase_crashlytics_collection_enabled"
    android:value="false" /> 

Add that to in AndroidManifest.xml.

Harish
  • 3,122
  • 2
  • 31
  • 46