Android Studio 错误:(8, 0) 未找到 ID 为“android"的插件 [英] Android Studio Error: (8, 0) Plugin with id 'android' not found

查看:39
本文介绍了Android Studio 错误:(8, 0) 未找到 ID 为“android"的插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Brew (brew install gradle) 在 OS X (10.9.3) 和 Gradle 1.1 上安装了 Android Studio (0.6.1).但是,我无法获得我的第一个 Hello World!项目...请帮我解决这个问题

I have installed Android Studio (0.6.1) on OS X (10.9.3) and Gradle 1.1 using Brew (brew install gradle). However, I can't get my first Hello World! project... Please help me solve this issue

build.gradle:

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

apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 19
    buildToolsVersion '19.1'
    defaultConfig {}
    productFlavors {}
}

dependencies {
}

错误信息:

错误:(8, 0) 未找到 ID 为android"的插件.

Error:(8, 0) Plugin with id 'android' not found.

Getting Build failed with an Exception Android Studio 0.4.3 and 0.4.4 post 和 ​​Android Studio:未找到 ID 为 'android-library' 的插件 帖子没有解决问题...

Getting Build failed with an Exception Android Studio 0.4.3 and 0.4.4 post and Android Studio: Plugin with id 'android-library' not found post does not solves the problem...

​​我链接的第二篇文章返回此错误留言:

错误:项目正在使用不受支持的 Gradle 版本.请使用 1.10 版.请指向支持的 Gradle 版本项目的 Gradle 设置或项目的 Gradle 包装器(如果适用.)修复 Gradle 包装器和重新导入项目 Gradle 设置

Error:The project is using an unsupported version of Gradle. Please use version 1.10. Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.) Fix Gradle wrapper and re-import project Gradle settings

推荐答案

您似乎错过了在 dependencies 块中添加 android gradle 插件依赖项.

It seems you have missed to add android gradle plugin dependency in dependencies block.

用这个替换顶部的 buildScript 部分并将你的项目与 gradle 同步

Replace the top buildScript section by this and sync your project with gradle

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

 apply plugin: 'android'

 android {
      compileSdkVersion 19
      buildToolsVersion '19.1.0'
      defaultConfig {
          applicationId 'YOUR_APP_PACKAGE'
          minSdkVersion 9
          targetSdkVersion 17
      }
      buildTypes {
          release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
          }
      }
      productFlavors {   }
  }

  dependencies {

   }

这篇关于Android Studio 错误:(8, 0) 未找到 ID 为“android"的插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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