升级为:
- Android Studio 3.0 金丝雀 2
- com.android.tools.build:gradle:3.0.0-alpha2
我有一个多模块项目(主应用程序+子模块)
包含在主应用程序中:
dependencies {
implementation project(path: ':testlib', configuration: 'default')
}
teSTLib 被定义为一个简单的 android 库项目,当包含在 gradle 2.3.0 中并通过编译项目(path: ':teSTLib')时可以正常工作
我收到以下 gradle 错误消息:
无法解析配置“:app:devDebug_signedCompileClasspath”的所有依赖项。 在“项目:teSTLib”上选择的配置“默认” 但它不能用作项目依赖项,因为 它不适合供其他组件使用。
在此上下文中,“不供其他组件使用”是什么意思?该模块被定义为一个 android 库。
这是 teSTLib 的 build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
}
}
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
我错过了什么?
最佳答案
我也遇到这个错误。 Android Studio 3.0 Canary 4 刚刚发布。我更新了它,这也将 gradle 更新到了 4.0rc1。
问题自行消失。
关于android - 模块包含 : not intended for consumption by other components - gradle:3. 0.0-alpha2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44309741/