android - Android gradle问题(当前2.4必需2.8)Android Studio

标签 android android-studio gradle android-gradle-plugin

我在尝试实现gcm时遇到问题。当我尝试同步Gradle文件时,出现此错误:

Warning:Gradle version 2.8 is required. Current version is 2.4. If using the gradle wrapper, try editing the distributionUrl in D:\MyProjects\Android\Enjoy\gradle\wrapper\gradle-wrapper.properties to gradle-2.8-all.zip

尝试转到包装器并将其更改为2.8,但仍无法正常工作。

这是我的应用程序build.gradle:
apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "enjoy.enjoyprague_restaurants_bars"
        minSdkVersion 17
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
//    android libraries activity, design
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'

//    application
    compile 'com.android.support:multidex:1.0.1'

//    volley for handlers
    compile 'com.mcxiaoke.volley:library:1.0.19'
    compile 'com.google.code.gson:gson:2.4'

//    picasso
    compile 'com.squareup.picasso:picasso:2.5.2'

//    simple xml
    compile('org.simpleframework:simple-xml:2.7.1') {
        exclude group: 'stax', module: 'stax-api'
        exclude group: 'xpp3', module: 'xpp3'
    }

//    floating action menu
    compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'

//    Google Map api
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.google.android.gms:play-services-gcm:8.4.0'
    compile 'com.google.maps.android:android-maps-utils:0.4'
}
//google gcm sender
apply plugin: 'com.google.gms.google-services'

和顶级构建gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
        classpath 'com.google.gms:google-services:2.0.0-alpha3'

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

allprojects {
    repositories {
        maven { url "http://dl.bintray.com/populov/maven" }
        mavenCentral()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

最佳答案

好的,所以Android Studio的问题非常严重。现在,您需要做的就是去问这个问题,并按照他们在那里所说的去做。将其离线处理。它将保证工作。

https://stackoverflow.com/a/21996772/4458300

关于android - Android gradle问题(当前2.4必需2.8)Android Studio,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34787311/

相关文章:

更改sdk路径后Android studio报错

gradle - Gradle ''项目刷新失败

android - ParseException 未找到查询结果

gradle - groovy/gradle用于文件收集过滤器和迭代的正确语法是什么?

android - Gradle:无法从嵌套项目中解析类路径依赖项

android - 在 Android 中找不到 ****.apk 错误

android - 请求运行时权限 React Native

android如何以编程方式更改进度条颜色

android - 如何使用 Bluestacks 模拟器调试 Android Studio 项目?

ubuntu下安卓模拟器没有声音