Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
467 views
in Technique[技术] by (71.8m points)

android - Gradle is issuing an error "Could not create plugin of type 'AppPlugin'"

I'm trying to create a simple android project with gradle. I work in a computer with Debian GNU/Linux 7 'wheezy'.

I followed the recomendations in Gradle Plugin User Guide - Android Tools Project Site, but it casts an error:

FAILURE: Build failed with an exception.

* Where:
Build file '/home/alex/Proyectos/MyLogin/build.gradle' line: 11

* What went wrong:
A problem occurred evaluating root project 'MyLogin'.
> Could not create plugin of type 'AppPlugin'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.817 secs

I followed the specifications:

  • Gradle 1.9
  • Plugin 0.7
  • SDK 17+ (actually 19)

I also started a project anew, and the results I showed were issued by the command gradle tasks as shown in the documentation.

I also tried gradle 1.10, but the result is the same.

Even this question was not usefull, since it solved with 'upgrading' to gradle 1.6 (I understand that plugin 0.7 requires at least gradle 1.9).

I tried this after failing with the same error in android-studio and IntelliJ Idea.

EDIT: I also tried with new projects in both IDEs, and got the same issue. But what most surprises me is that both IDEs use gradle 1.8 in their wrapped form. I tried to cinfigure both of them to use my local gradle install, but still the same issue.

What am I doing wrong? Is it a bug? How can I avoid the problem?

Please, help me.

EDIT: Here is my build.gradle

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

apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 14
    buildToolsVersion '19.0.1'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 19
    }
}

sourceCompatibility = 1.6

version = '0.1'

dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    //compile project(':core')
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Google made a mistake with version 0.7.2 of the Gradle plugin:

Note: 0.7.2 requires Java7. This is a mistake. Use 0.7.3 instead.

Release 0.7.3 re-enables Java6 support. Declaring Gradle 0.7.3 in my build files does indeed resolve this for me.

No one is perfect :)

http://tools.android.com/tech-docs/new-build-system


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...