gpt4 book ai didi

android - 构建错误 Android : Configuration with name 'default' not found

转载 作者:行者123 更新时间:2023-11-30 02:08:26 26 4
gpt4 key购买 nike

我试图从论坛中找到以下错误消息的答案。我不能。

错误:

错误:配置项目“:app”时出现问题。

Cannot evaluate module soundprocessing : Configuration with name 'default' not found.

详情

项目结构:

安卓

|__  app

|__ net (java library)

|__ soundprocessing (Android Library without any activity)

顶层的 Build.gradle (Android)

// 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:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}

settings.gradle (at top level Android)

include ':app',':net', ':soundprocessing'

应用内的 Build.gradle

apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.clinicloud.app"
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':net')
compile 'io.realm:realm-android:0.80.1'
compile project(':soundprocessing')
}

build.gradle(内网)

apply plugin: 'java'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

build.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:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}

顶层的settings.gradle有这段代码

include ':app',':net', ':soundprocessing'

************我从声音处理应用程序中删除了 settings.gradle,因为其中一个论坛答案说在多项目依赖中应该只有一个 settings.gradle。

错误:配置项目“:app”时出现问题。

Cannot evaluate module soundprocessing : Configuration with name 'default' not found.

现在我也添加了我的 settings.gradle。那么可能是什么问题呢?

最佳答案

我在将库项目添加到应用程序时遇到了同样的问题。我是这样解决的...

settings.gradle(在您的应用中,而不是在库中)编辑它以包含您的库子文件夹:

include ':app', ':library_project'
project(':library_project').projectDir = new File('../library_project/library')

在我的示例中,观察 /library 子文件夹。我一指定它,错误就被修复了。

注意:此子文件夹将取决于您的库项目,并且可能有所不同。

关于android - 构建错误 Android : Configuration with name 'default' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30431942/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com