配置名为'默认'未找到。 Android的工作室 [英] Configuration with name 'default' not found. Android Studio

查看:271
本文介绍了配置名为'默认'未找到。 Android的工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个机器人工作室的应用程序。它有一个libary依赖(Android的引导),当我尝试同步摇篮,说我用的名字默认未找到错误配置。

i have a android studio app. It have a libary dependency (Android-Bootstrap), when i try to sync gradle, say me error Configuration with name 'default' not found..

我的结构是

-FTPBackup
   -fotobackup
     -build.gradle
   -Libraries
     -Android-Bootstrap
       -Settings.gradle
       -build.gradle
-Settings.gradle
-Build.gradle

在FTPBackup settings.gradle和build.gradle:

The FTPBackup settings.gradle and build.gradle:

include ':fotobackup'
include ':libraries:Android-Bootstrap',':Android-Bootstrap'


// 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.9.+'
    }
}

allprojects {
    repositories {
        mavenCentral()
    }
}

和内fotobackup的build.gradle是:

And the build.gradle inside fotobackup is:

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion '19.0.3'

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

apply plugin: 'android'

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:support-v4:+'
    compile project (':libraries:Android-Bootstrap')
}

该libarary从<一个downlaoded href="https://github.com/Bearded-Hen/Android-Bootstrap">https://github.com/Bearded-Hen/Android-Bootstrap它有build.gradle,设置等。

The libarary is downlaoded from https://github.com/Bearded-Hen/Android-Bootstrap and it has build.gradle, settings etc..

什么是错?

推荐答案

首先,它不做好事,有一个以上的 settings.gradle 的文件 - 它只是着眼于顶部-level之一。

For one, it doesn't do good to have more than one settings.gradle file -- it only looks at the top-level one.

当你得到这个配置名称为默认未找到的错误,这真的令人困惑,但它的意思是,摇篮正在寻找一个模块(或build.gradle)文件的某个地方,而且它没有找到它。你的情况,你有这样的在 settings.gradle 文件:

When you get this "Configuration with name 'default' not found" error, it's really confusing, but what it means is that Gradle is looking for a module (or a build.gradle) file someplace, and it's not finding it. In your case, you have this in your settings.gradle file:

include ':libraries:Android-Bootstrap',':Android-Bootstrap'

这是使摇篮寻找一个 FTPBackup /库/ Android的引导的图书馆。如果你使用的是区分大小写的文件系统(你有没有输入错误的在你的问题时,你的意思是),它可能无法找到 FTPBackup /库/ Android的引导,因为这样的区别。它也在寻找另一个库在 FTPBackup / Android的引导和它肯定不会找到一个,因为该目录是不存在的。

which is making Gradle look for a library at FTPBackup/libraries/Android-Bootstrap. If you're on a case-sensitive filesystem (and you haven't mistyped Libraries in your question when you meant libraries), it may not find FTPBackup/Libraries/Android-Bootstrap because of the case difference. It's also looking for another library at FTPBackup/Android-Bootstrap, and it's definitely not going to find one because that directory isn't there.

这应该工作:

include ':Libraries:Android-Bootstrap'

您需要在您的依赖相同的区分大小写的规范块:

compile project (':Libraries:Android-Bootstrap')

这篇关于配置名为'默认'未找到。 Android的工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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