Gradle 发出错误“无法创建‘AppPlugin’类型的插件"; [英] Gradle is issuing an error "Could not create plugin of type 'AppPlugin'"

查看:50
本文介绍了Gradle 发出错误“无法创建‘AppPlugin’类型的插件";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 gradle 创建一个简单的 android 项目.我在一台装有 Debian GNU/Linux 7 'wheezy' 的计算机上工作.

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

我遵循了 Gradle 插件用户指南 - Android 工具项目站点,但它抛出了一个错误:

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

我遵循了规范:

  • Gradle 1.9
  • 插件 0.7
  • SDK 17+(实际 19)

我也重新开始了一个项目,我显示的结果是由命令gradle tasks发出的,如文档所示.

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

我也试过 gradle 1.10,但结果是一样的.

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

甚至这个问题也没有用,因为它通过升级"解决了gradle 1.6(我知道插件 0.7 至少需要 gradle 1.9).

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).

我在 android-studioIntelliJ Idea 中以同样的错误失败后尝试了这个.

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

我还在两个 IDE 中尝试了新项目,但遇到了同样的问题.但最令我惊讶的是,这两个 IDE 都以包装形式使用 gradle 1.8.我试图让他们都使用我的本地 gradle 安装,但仍然是同样的问题.

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?

请帮帮我.

这是我的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')
}

推荐答案

Google 在 Gradle 插件:

注意:0.7.2 需要 Java7.这是个错误.改用 0.7.3.

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

0.7.3 版重新启用 Java6 支持.在我的构建文件中声明 Gradle 0.7.3 确实为我解决了这个问题.

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

没有人是完美的 :)

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

这篇关于Gradle 发出错误“无法创建‘AppPlugin’类型的插件";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆