Search code examples
androidandroid-studiocrashlyticscrashlytics-android

Unable to extract Crashlytics build info from the dropped APK


I'm trying to upload an .apk file to Crashlytics to be distributed with the 'Beta' app, but I'm getting the following error when dropping my .apk in the upload menu:

Unable to extract Crashlytics build info from the dropped APK. Please make sure your Crashlytics build tool plugin is installed and enabled.

I've enabled Crashlytics as suggested by the Fabric app: I've put Fabric.with(this, new Crashlytics(), new CrashlyticsNdk()); in my MainActivity, and my build.gradle file is as follows:

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

crashlytics {
    enableNdk true
    androidNdkOut 'src/main/obj'
    androidNdkLibsOut 'src/main/libs'
}

And:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.1@aar') {
        transitive = true;
    }

I'm also using the following settings:

targetSdkVersion 25
compileSdkVersion 25
buildToolsVersion '26'
classpath 'com.android.tools.build:gradle:2.3.0'

I don't know what's going wrong. I've used Crashlytics and the distribution tool in the past without any issues. The Crashlytics plugin does seem to work in the app though, when I trigger an exception it shows up in the web interface.

I'm kinda lost here to what the problem might be so any help is greatly appreciated.


Solution

  • Fixed it by reinstalling Android Studio.

    Edit:

    I found out the issue is related to enabling Instant Run in Android Studio, a while after reinstalling Android Studio I enabled Instant Run and the issue returned.

    Disabling Instant Run again solved the issue

    How to turn off Instant Run is explained in this post