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

前端 未结 9 1267
北恋
北恋 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

    Working fine with the following line with AndroidStudio 3.5

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
    
    0 讨论(0)
  • 2020-12-28 12:47

    when you import a project from external resources some files will be generated as it contains information specific to your local configuration, and one of them is gradle-wrapper.properties, downgrade to a lower version and rebuild the project and the error should be gone

    distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip
    

    to

    distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
    
    0 讨论(0)
  • 2020-12-28 12:52

    change on gradle.wrapper.properties your value of distributionUrl=https://services.gradle.org/distributions/gradle-4.10.1-all.zip change to this and android studio will give you automatically update on your gradle and it should be fine

    0 讨论(0)
提交回复
热议问题