我试图将我的AS升级到最新的beta2,并遇到以下问题,我的app
和lib
模块。升级到Android 3.0 beta 2后无法解析库项目
在我app
build.gradle
我有2种口味
flavorDimensions "default"
productFlavors {
stage {
applicationId "com.mycompany.hello.stage"
resValue "string", "app_name", "Stage"
}
production {
applicationId "com.mycompany.hello.stage.production"
resValue "string", "app_name", "Live"
}
}
我指定的应用程序将如下只跟特定类型的我lib
:
stageCompile project(path: ':lib', configuration: 'debug')
productionCompile project(path: ':lib', configuration: 'release')
lib
build.gradle
文件我只有建立类型和没有风味块
publishNonDefault true
buildTypes {
debug {
versionNameSuffix ".debug"
}
release {
versionNameSuffix ".release"
minifyEnabled true
}
}
以上代码是我的最佳知识,app
将取决于构建变体并与lib
的特定构建变体进行交谈。它工作完美,直到我升级到AS 3.0。
这里是gradle错误消息......我不确定这是否是由我的两个gradle文件中的flavorDimensions
不匹配造成的。
Error:Could not determine the dependencies of task ':app:compileStageDebugAidl'.
> Could not resolve all task dependencies for configuration ':app:stageDebugCompileClasspath'.
> Could not resolve project :lib.
Required by project :app
> Project :app declares a dependency from configuration 'stageCompile' to configuration 'debug' which is not declared in the descriptor for project :lib.