发生评估根项目>未找到com.android.application的插件

时间:2016-06-16 19:54:20

标签: java android gradle android-gradle

下载了一个有问题的Android项目我在gradle文件中有这个...

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

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

但我收到了错误..

Plugin with id 'com.android.application' not found

任何想法是什么问题?

1 个答案:

答案 0 :(得分:0)

尝试root gradle:

buildscript {
  repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
  }
  dependencies {
    // 2.1.2 is newest  plugin but required studio >=  2.1
    classpath 'com.android.tools.build:gradle:1.5.0' 
    // The Fabric Gradle plugin uses an open ended version to react
    // quickly to Android tooling updates
    classpath 'io.fabric.tools:gradle:1.+'
  }
}

repositories {
    jcenter()
    maven { url 'https://maven.fabric.io/public' }
}
在app或lib gradle中

apply plugin: 'com.android.application'
//Put Fabric plugin after Android plugin
apply plugin: 'io.fabric'

for fabric version plugin请参阅: https://s3.amazonaws.com/fabric-artifacts/repo/io/fabric/tools/gradle/maven-metadata.xml

<latest>1.21.5</latest>
<release>1.21.6</release>
不要在libs / classes中使用加号,这会减慢构建过程:而是 classpath&#39; io.fabric.tools:gradle:1。+&#39 ; 使用 - &gt; classpath&#39; io.fabric.tools:gradle:1.21.6&#39;