找不到名称为“默认"的 Android Studio Gradle 配置 [英] Android Studio Gradle Configuration with name 'default' not found

查看:40
本文介绍了找不到名称为“默认"的 Android Studio Gradle 配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Android Studio (0.1.5) 编译我的应用程序时遇到问题.该应用程序使用了我包含的 2 个库,如下所示:

I am having problems compiling my app with Android Studio (0.1.5). The app uses 2 libraries which I have included as follows:

settings.gradle

include ':myapp',':library',':android-ColorPickerPreference'

build.gradle

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.4'
    }
}
apply plugin: 'android'

dependencies {
    compile files('libs/android-support-v4.jar')
    compile project(':library')
    compile project(':android-ColorPickerPreference')

}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }
}

编译时我收到此消息:

  Gradle: A problem occurred configuring project ':myapp'.
   > Failed to notify project evaluation listener.
   > Configuration with name 'default' not found.

你能帮我处理这条消息吗?谢谢!

Could you help me with this message? Thanks!

推荐答案

就我而言,在使用 gradle tasks --info 编译后,日志在那里:

In my case, after compiling with gradle tasks --info, the log was there :

使用空构建评估项目 ':libraries:VolleyLibrary'文件.

Evaluating project ':libraries:VolleyLibrary' using empty build file.

所以找不到库的build.gradle文件.原因是文件夹结构.

So it failed to find build.gradle file of the library. Reason is the folder structure.

原来是

-libraries
--volley
---VolleyLibrary

应该是

-libraries
--VolleyLibrary

这篇关于找不到名称为“默认"的 Android Studio Gradle 配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆