Android Studio Gradle DSL method not found: 'android()' — Error(17,0)

来源:互联网 发布:微信红包开发源码 编辑:程序博客网 时间:2024/06/05 18:19


I went ahead and downloaded the project from the link you provided: http://javapapers.com/android/android-chat-bubble/

Since this is an old tutorial, you simply need to upgrade the software, gradle, the android build tools and plugin.

Make sure you have the latest Gradle and Android Studio:

  • https://www.gradle.org/
  • http://tools.android.com/tech-docs/new-build-system/version-compatibility

build.gradle:

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

app/build.gradle:

apply plugin: 'com.android.application'android {    compileSdkVersion 23    buildToolsVersion '23.0.3'    defaultConfig {        minSdkVersion 9        targetSdkVersion 23        versionCode 1        versionName '1.0'    }}dependencies {    compile 'com.android.support:appcompat-v7:23.2.1'}

Then run gradle:

gradle installDebug





I have tried to manage this issue via below steps :

Delete android { ... } block in top level root gradle file

Look into

 compileSdkVersion 22 buildToolsVersion "22.0.0"

lines of code in app/gradle file here only one of the version persent in below dropdown should be present else it would give provide option to downloaad the same.


转载:http://stackoverflow.com/questions/27735646/android-studio-gradle-dsl-method-not-found-android-error17-0

参考:http://www.hloong.com/?p=100



0 0
原创粉丝点击