Kys*_*o84 5 android android-library android-studio build.gradle android-productflavors
我有一个带有主应用程序和 3 个模块的项目。他们像彼此依赖
app (android application)
|
--- module1 (android library)
|
--- module2 (android library)
|
--- module3 (android library)
Run Code Online (Sandbox Code Playgroud)
我将 AS 3.0 与 BuildTool 3.0.0-alpha5 一起使用。
我应用了文档中描述的更改:https
: //developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#variant_dependencies
这是我的
build.gradle(应用程序)
apply plugin: 'com.android.application'
android {
...
buildTypes {
debug {}
qa {}
release {}
}
flavorDimensions "default"
productFlavors {
flavor1 {dimension = "default"}
flavor2 {dimension = "default"}
}
}
dependencies {
...
implementation project(path: ':module1')
...
}
Run Code Online (Sandbox Code Playgroud)
这是我的 build.gradle ( module1 )
apply plugin: 'com.android.library'
android {
...
buildTypes {
debug {}
qa {}
release {}
}
}
dependencies {
...
implementation project(path: ':module2')
...
}
Run Code Online (Sandbox Code Playgroud)
这是我的 build.gradle (module2)
apply plugin: 'com.android.library'
android {
...
buildTypes {
debug {}
qa {}
release {}
}
}
dependencies {
...
implementation project(path: ':module3')
...
}
Run Code Online (Sandbox Code Playgroud)
我有一个 Gradle 同步警告:
警告:
模块 'module1' 选择了变体 'debug',但模块 ''app'' 取决于变体 'qa
' 在“Build Variants”窗口中选择 'module1'
有人知道我错过了什么吗?
| 归档时间: |
|
| 查看次数: |
1770 次 |
| 最近记录: |