Gradle:id为';android库';找不到

Gradle:id为';android库';找不到,android,gradle,Android,Gradle,我正试图用Gradle自动化我的项目 我有几个应用程序和一个库项目。 仔细阅读后,这是my build.gradle的简化视图: buildscript { repositories { mavenCentral() maven { url "http://saturday06.github.io/gradle-android-scala-plugin/repository/snapshot" } }

我正试图用Gradle自动化我的项目

我有几个应用程序和一个库项目。 仔细阅读后,这是my build.gradle的简化视图:

buildscript {
    repositories {
        mavenCentral()
        maven {
            url "http://saturday06.github.io/gradle-android-scala-plugin/repository/snapshot"
        }
    }
    dependencies {
        // 0.8.3 con Gradle 1.10
        classpath 'org.gradle.api.plugins:gradle-android-plugin:1.2.1'
    }
}

apply plugin: 'idea'

project(':MyApp') {
    ext.apl = true
}

project(':MyLibrary') {
    ext.apl = false
}

subprojects {
    if (project.apl) {
        apply plugin: 'android'
        dependencies {
            compile 'ch.acra:acra:4.5.0'
        }
    }
    if (project.scala) {
        apply plugin: 'android-scala'
        scala {
            target "jvm-1.7"
            addparams '-feature'
        }
    } else {
        apply plugin: 'android-library'
    }
    android {
        compileSdkVersion 17
        buildToolsVersion '19.1.0'

        signingConfigs { ... }
        defaultConfig {
            minSdkVersion 8
            targetSdkVersion 17
        }

        sourceSets {
            compileOptions {
                sourceCompatibility JavaVersion.VERSION_1_7
                targetCompatibility JavaVersion.VERSION_1_7
            }
        }

        buildTypes {
            debug {
                runProguard false
                proguardFile file('proguard-rules.txt')
                signingConfig signingConfigs.depurar
            }

            release {
                runProguard true
                proguardFile file('proguard-rules.txt')
                signingConfig signingConfigs.entregar
            }
        }
    }
}

project(':MyLibrary') {
    dependencies {
        compile "com.github.tony19:logback-android-core:1.1.1-2"
        compile "com.github.tony19:logback-android-classic:1.1.1-2"
        compile "org.slf4j:slf4j-api:1.7.6"

    }
}

project(':MyApp') {
    dependencies {
        compile 'com.android.support:appcompat-v7:19.1.0'
        compile('org.apache.httpcomponents:httpmime:4.1.1') {
            transitive = false
        }
        compile project(':Bibl')
    }
}
我的settings.gradle是:

include 'MyLibrary', 'MyApp'
只有一个版本

问题是Gradle抱怨说

Plugin with id 'android-library' not found
每当我尝试使用这个插件。 应用插件:“安卓”没有问题

文档明确指出,对于库,必须使用“android库”。 我用的是Gradle 1.10

最新版本的gradle android插件(如1.2.1)的文档是否过时?因为官方文档是0.9版的

最新版本的gradle android插件(如1.2.1)的文档是否过时

引述:

我们非常抱歉地宣布,这个插件的开发已经停止。谷歌基于Gradle创建了自己的Android开发工具链,取代了这个插件

有关更多信息,请参阅


我通常将android库与android插件的官方Gradle关联起来;我不知道不推荐的
gradleandroid插件是否支持它。

谢谢。我感到困惑,好的是:“com.android.tools.build:gradle:0.10.4”而不是“org.gradle.api.plugins:gradle-android-plugin:1.2.1”。