5

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.

Daan
  • 147
  • 15
  • 1
    That's a pretty old version of the NDK SDK. If you upgrade to 1.1.6 do you get the same error? – Alexizamerican Aug 28 '17 at 23:56
  • Possible duplicate of [Unable to upload apk to Crashlytics](https://stackoverflow.com/questions/37972121/unable-to-upload-apk-to-crashlytics) – 6155031 Feb 19 '19 at 10:06

3 Answers3

4

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

Daan
  • 147
  • 15
0

Or you can build it through Gradle command line likeso "./gradlew clean assemble[yourBuildVariant]" and drag and drop that to Fabric Beta.

Mark Pazon
  • 6,167
  • 2
  • 34
  • 50
0

Selecting Clean Project under Build on the Main Menu fixed the problem for me.

Leonardo Sibela
  • 1,613
  • 1
  • 18
  • 39