Gradle build fails: Unable to find method 'org.gradle.api.tasks.testing.Test.getTestClassesDirs()Lorg/gradle/api/file/FileCollection;'

前端 未结 9 1275
北恋
北恋 2020-12-28 12:25

When i am trying to compile a imported project from github, my gradle build always fails with the following exeption.

Unable to find method \'org.gradle.api.         


        
9条回答
  •  伪装坚强ぢ
    2020-12-28 12:44

    I fix same as this error by add classpath 'com.android.tools.build:gradle:3.2.1' in the build.gradle project

    buildscript {
    
        repositories {
            maven { url 'https://maven.google.com' }
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    

提交回复
热议问题