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

Project was in working state but since today build is failing with above error.

Android Studio 3.2 Preview.

Rohit Surwase
  • 701
  • 5
  • 17

8 Answers8

66

Update: Check Mike's answer first!

Old answer:

It looks like Fabric released a new version thats breaks the build for some apps.

If you have the line io.fabric.tools:gradle:1.+ (which is recommended by Fabric, but not ideal) you will automatically use the new version.

In the meantime you can replace 1.+ with the latest "stable" version which is 1.25.4. io.fabric.tools:gradle:1.25.4

Pang
  • 9,564
  • 146
  • 81
  • 122
maxoumime
  • 3,441
  • 1
  • 17
  • 23
  • 4
    Small update: the latest version is 1.26.0. But that doesn't work. Setting the version to 1.25.4 does the trick – bogdan Sep 24 '18 at 17:57
  • 1
    When you are using 1.+ version which basically use latest version 1.26.0 and the bug occurred. So, make sure you are using 1.25.4 to resolve the issue – 0xAliHn Sep 25 '18 at 08:26
  • Solved but this is not the best solution. Waiting fabric fix this. – Pedro Paulo Amorim Sep 25 '18 at 16:29
  • there was a problem with version 1.26, with version 1.25.4 all ok – Andrew Glukhoff Sep 26 '18 at 05:01
  • It is generally bad practice to use `+` in version numbers. The fact that Fabric recommends this for their plugin has always irked me. Instead, I manually check when there are new versions using this: https://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml – yuval Sep 28 '18 at 01:31
33

Mike from Fabric here. If you're using version 3.2 of the Android Studio Gradle plugin, upgrading to 4.10 of Gradle and 1.26.0 of the Fabric Gradle plugin will address this issue.

If you use a version of AS Gradle less then 3.2, you won't encounter the issue, but also won't be getting the benefits of the latest release. You will hit this issue if you've updated to 3.2 of AS Gradle and 1.26.0 of Fabric's Gradle plugin, but are using a version of Gradle lower than 4.10 of Gradle.

Mike Bonnell
  • 16,181
  • 3
  • 61
  • 77
12

when you update with android studio 3.2 and using fabric gradle version 1.+ then you have to change fabric gradle version 1.+ to 1.25.4 in biuld.gradle(project) file

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

dependencies {
    //classpath 'io.fabric.tools:gradle:1.+'     // old version
    classpath 'io.fabric.tools:gradle:1.25.4'   // new version
}
}

Note: Although the fabric gradle latest version is 1.26.0 but it's not stable version.stable version is 1.25.4. its work fine.

Shomu
  • 2,734
  • 24
  • 32
10

Update

classpath 'io.fabric.tools:gradle:1.+'

To

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

https://docs.fabric.io/android/changelog.html#september-27-2018

Version 1.26.0 was the problem

Pauland
  • 1,974
  • 16
  • 25
6

You only need to update Gradle version (in Gradle-Wrapper.properties). for ex:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
DrMorteza
  • 2,067
  • 2
  • 21
  • 29
3

Following Mike's answer the file you need to change is in:

project\gradle\wrapper\gradle-wrapper.properties

The latest version is 4.10.2.

Nelson Almendra
  • 784
  • 1
  • 9
  • 20
2

For me, the problem appeared when I updated to AS 3.2-RC02 which requires the Android plugin 3.2.0-rc02.

So I had to roll back to AS 3.1.4 which is the current stable version so I could downgrade my version of the Android plugin. I am using Android plugin 3.2.0-rc01

I also had to downgrade the fabric plugin to 1.24.4

JDenais
  • 2,956
  • 2
  • 21
  • 30
0

Now seeing this with Gradle 5.1.1

Crashlytics version: 2.9.3

Gradle Tools version: 1.21.7

ERROR: Could not find method leftShift() for arguments [com.crashlytics.tools.gradle.tasks.FabricTaskBuilder$_pluginGenerateResources_closure4@28a32300] on task ':App:fabricGenerateResourcesDebug' of type org.gradle.api.DefaultTask.

tricknology
  • 1,092
  • 1
  • 15
  • 27