Android Studio第一个项目错误

时间:2014-06-17 10:28:35

标签: android android-studio

我已经在OS X(10.9.3)上成功安装了Android Studio(0.6.1)。我无法获得我的第一个Hello World!项目...请帮我解决这个问题

这是我得到的错误:

  

错误:(19,0)构建脚本错误,找不到支持的Gradle DSL方法:   '机器人()'!

     

可能的原因可能是:
     - 您正在使用不存在该方法的Gradle版本(Fix Gradle settings)      - 你没有申请提供方法的Gradle插件(Apply Gradle插件)      - 或者构建脚本中存在错误(转到源代码)

更新:(代码,错误消息)

脚本:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {}
}

apply plugin: 'android'

repositories {
    mavenCentral()
}

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

dependencies {
}

错误讯息:

  

错误:(8,0)带有id' android'的插件没找到。

1 个答案:

答案 0 :(得分:0)

将其修改为下一个:

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

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
  } 
}

apply plugin: 'android' 

repositories {
  mavenCentral()
} 

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

dependencies { }
相关问题