该项目使用的是不受支持的Android Gradle插件版本(0.12.2)。 Android studio 1.4.1中推荐的版本是1.3.0

时间:2015-11-04 02:12:51

标签: android-studio

问题让我担心几天,我下载了最新的Android工作室,并从我的旧eclipse项目中导入了库项目的源代码,我尝试通过很多帖子解决问题,但还是运气不好,还有我的构建。 gradle,android块的内容由android studio生成。

apply plugin: 'android-library'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
}


buildscript {
    repositories {
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'   }
}

android {
    compileSdkVersion 20
    buildToolsVersion "21.1.2"


    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
}

这是我的gradle-wrapper.properties,代码由Android studio生成。

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip

和我的AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="es.disegnator"
    android:versionCode="1"
    android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="3"
    android:targetSdkVersion="23" />

它仍会显示消息:

Gradle sync failed: The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.3.0.

请帮我解决问题。

0 个答案:

没有答案