Gradle无法刷新Android Studio

时间:2014-05-01 08:05:10

标签: android gradle android-studio android-gradle

我一直在安装和重新安装AndroidStudio,因为我一直收到错误

>  Gradle 'android' project refresh failed:
>                Open quote is expected for attribute "{1}" associated with an  element type  "language".

我的所有小组成员都可以打开项目,除了我之外没有收到此错误。我急需帮助,我只想完成本学期的小组项目。谢谢你的帮助。

settings.gradle

include ':app'

app文件夹中的build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {

    compile 'com.android.support:appcompat-v7:+'
    compile 'com.google.android.gms:play-services:4.3.23'
    compile 'com.android.support:support-v4:18.0.0'
    files('libs/json-simple-1.1.1.jar')
    compile files('libs/json-simple-1.1.1.jar')
}

gradle文件夹中的build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

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

allprojects {
    repositories {
        mavenCentral()
    }
}

更新:做了另一个重新安装的Android Studio,现在它给了我这个错误。

Failed to refresh Gradle project 'android'
           Out of memory: Java heap space. Configure Gradle memory settings using '-Xmx' JVM option (e.g. '-Xmx2048m'.)
           Please fix the project's Gradle settings.
           Gradle settings

1 个答案:

答案 0 :(得分:0)

您可能输入了封闭引号(“)而不是打开引号(")。更改属性开头和结尾的引号。