简体   繁体   中英

I have a problem with fabric and crashlytics when building my Android App

This is the error I am seeing.

Could not find method create() for arguments [crashlyticsStoreDeobsRelease, class com.crashlytics.tools.gradle.tasks.StoreMappingFileTask, com.android.build.gradle.internal.scope.BuildArtifactsHolder$FinalBuildableArtifact@1711854a] on task set of type org.gradle.api.internal.tasks.DefaultTaskContainer.

The cause of the issue seems incompatibility Fabric version with latest version of Gradle.The below works for me. Don't upgrade your Gradle version, Stick with your previous version and Sync the project once.

My Android Studio Version is 3.2

project.gradle

dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
    }

build.gradle

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

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

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

For me this happened after upgrading to Android Studio 3.2 which come along with Gradle 4.6. So i switched back from

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

to

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

for the moment.

Try replacing the line io.fabric.tools:gradle:1.+ by the latest stable Fabric version which is 1.25.4. at the moment: io.fabric.tools:gradle:1.25.4

I had problem when I updated my Android studio from 3.1.4 to 3.2.

The way I got the solution. I changed in the Build.gradle (app).

from

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}

to

dependencies {
    classpath 'io.fabric.tools:gradle:1.25.4'
}

As others have mentioned, there's some type of conflict between io.fabric.tools:gradle:1.26.0, and Gradle 4.6. So I found the best solution, rather than roll back io.fabric.tools:gradle, seems to be to upgrade Gradle to the latest version, 4.10.2. Seemed to work for my project without issue.

For me this happened after upgrading to Android Studio 3.2 which come along with Gradle 4.6. So i switched back to gradle 4.4 for the moment. Maybe a bug.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM