ERROR: No signature of method: com.crashlytics.tools.gradle.CrashlyticsPlugin.findObfuscationTransformTask()

别来无恙 提交于 2019-12-03 04:41:37

问题


I am getting the following error while trying to build my project on Android Studio:

ERROR: No signature of method: com.crashlytics.tools.gradle.CrashlyticsPlugin.findObfuscationTransformTask() is applicable for argument types: (java.lang.String) values: [DevDebug]

How to solve this?


回答1:


This seems to be an issue related to version "1.28.0" of "io.fabric.tools:gradle".

Usually this kind of problem occurs if groupId:artifactId:n.+ structure of versioning is used inside dependency (app level/project level). In this case:

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

Because it auto updates the version, and as a result, if there is any fatal error in the latest version, the project is likely to face a crash due to build/runtime error.

Android Studio always suggests to 'Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds...'

One working solution was found to be downgrading to a specific previous version like 1.27.1 or any other stable latest version prior to 1.28.0, like:

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

Remember to check both gradle files (app level/project level) to see where the above dependency has been declared and change accordingly.




回答2:


hey this error raised because of Many android developers uses

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

like this so that compiler not find exactly match of the fabric version and error raise and also M. Arabi Hasan Sakib is right

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

also raise this type of error, solution mentioned by M. Arabi Hasan Sakib is also working. I tried below code and its working for me hope it works for you people also or just replace the line like

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

(Put this code into the build.gradle in app directory)

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

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

repositories {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
    maven {
        url "http://dl.bintray.com/lukaville/maven"
    }
}


来源:https://stackoverflow.com/questions/55214993/error-no-signature-of-method-com-crashlytics-tools-gradle-crashlyticsplugin-fi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!