gpt4 book ai didi

Android Studio Gradle 项目刷新失败 :Configuration with name 'default' not found

转载 作者:行者123 更新时间:2023-11-29 16:01:50 25 4
gpt4 key购买 nike

我想将库 wheel 导入到我的项目中。我做了什么:

1. I imported library wheel to Android Studio in order to have build.gradle in it.
2. I created new folder in my project called libraries and put wheel library to it.
3. I put this code to my settings.gradle: include ':app:libraries:wheel'
4. I put this code to build.gradle: compile project('libraries:wheel');
5. I tried to sync gradle but it failed

我的项目结构是这样的:

我的 build.gradle 在这里:

apply plugin: 'android'

android {
compileSdkVersion 19
buildToolsVersion "19.0.3"

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

dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project('libraries:wheel');

}

我的设置等级:

include ':app'
include ':app:libraries:wheel'

我的失败信息:

Gradle 'LiteTap' project refresh failed:
Configuration with name 'default' not found.

我该如何解决?

最佳答案

在终端中尝试命令 gradlew tasks --info

您可能会看到“Evaluating project ':libraries:wheel' using empty build file.”

可能是因为wheel不是android studio项目,AS没有找到build.gradle文件

我通过使用 android studio 导入库而不是直接将其复制到 YOURPRO\libraries 来解决这个问题。

How to use a library project in android studio并且有效。

请注意,如果您创建一个libraries 文件夹并拖动它会更整洁

wheel 导入后的文件。记得加

include:libraries:pullToRefreshListView 在你的 settings.gradle 文件中

关于Android Studio Gradle 项目刷新失败 :Configuration with name 'default' not found,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23845009/

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