【发布时间】:2015-06-02 15:46:13
【问题描述】:
我正在使用 BottomSheet 库来创建 BottomSheet menu,如 Google 文档中所述。
我将 BottomSheet 库添加到我的项目中,但是当我与 gradle 同步时,我收到了错误消息。我尝试了Error: Configuration with name 'default' not found in Android Studio 上列出的所有答案以及 stackoverflow 上列出的其他解决方案,但问题仍然存在。
这是我项目的 build.gradle 和设置文件:
BottomSheet/build.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
allprojects {
group = POM_GROUP_ID
version = POM_VERSION
repositories {
jcenter()
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
}
task wrapper(type: Wrapper) {
gradleVersion = '1.12'
}
app/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.khsingh.stockysingh"
minSdkVersion 15
targetSdkVersion 21
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.0.0'
compile "com.android.support:appcompat-v7:21.0.+"
compile project(":BottomSheet")
}
root/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', ':BottomSheet'
project(':BottomSheet').projectDir = new File('library/BottomSheet')
【问题讨论】:
标签: android android-studio gradle