配置名称'默认'找不到我修改.gradle

时间:2015-08-12 09:21:25

标签: android gradle

我想从GitHub导入名为 StackBlur 的项目作为我的库。但是当我修改.gradle文件时发生了错误。

应用程序/的build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.badprinter.yobey"
        minSdkVersion 11
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile project (':libs:StackBlur')
}

settings.gradle:

include ':app'
include ":libs:StackBlur"

我的项目结构如下:

-YoBey
-app
 -build.gradle
-libs
 -StackBlur
   -src
   -build.gradle
-settings.gradle
-build.gradle

1 个答案:

答案 0 :(得分:0)

将“”替换为''

试试这个:

应用程序/的build.gradle:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.1'
    compile project (":libs:StackBlur")
}

settings.gradle:

include ':app'
include ':libs:StackBlur'