Gradle DSL method not found: 'classpath()'

前端 未结 1 1587
独厮守ぢ
独厮守ぢ 2021-01-20 08:11

  • The project \'FeedBack\' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. \'testCompile\' was added in 1.1.0).
  • 相关标签:
    1条回答
    • 2021-01-20 08:39

      You have to insert classpath dependencies inside buildscript block.

      buildscript {
          repositories {
              jcenter()
      
              maven { url 'https://maven.fabric.io/public' }
          }
      
          // move it here
          dependencies {
              classpath 'com.android.tools.build:gradle:2.1.0'
      
              // NOTE: Do not place your application dependencies here; they belong
              // in the individual module build.gradle files
      
              // The Fabric Gradle plugin uses an open ended version to react
              // quickly to Android tooling updates
              classpath 'io.fabric.tools:gradle:1.+'
          }
      }
      
      
      
      allprojects {
          repositories {
              jcenter()
          }
      }
      
      task clean(type: Delete) {
          delete rootProject.buildDir
      
      0 讨论(0)
    提交回复
    热议问题