我有一个包含 2 个模块的项目:一个具有构建类型的应用程序 (Java)debug
, release
, and enterprise
和一个 Kotlin 库(release
and debug
)由应用程序使用。
我正在使用 AndroidX 并且我的中有以下内容gradle.properties
:
android.useAndroidX=true
android.enableJetifier=true
如果我通过 Gradle 运行该项目,我会收到一堆编译错误(预期)。但如果我尝试在 Android Studio (3.2 Beta 5) 中使用它,特别是在尝试与 Gradle 模型同步时,我会得到以下信息:
Unable to resolve dependency for ':app@debug/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
Unable to resolve dependency for ':app@release/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
Unable to resolve dependency for ':app@releaseUnitTest/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
Unable to resolve dependency for ':app@enterprise/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
Unable to resolve dependency for ':app@enterpriseUnitTest/compileClasspath': Failed to transform file 'some-lib-release.aar' to match attributes {artifactType=processed-aar} using transform JetifyTransform
My settings.gradle
:
include ':app',':some-lib'
project(':some-lib').projectDir = file ('../some-lib/lib')
库模块最终将成为该应用程序和其他应用程序使用的自己的库,但在我开发它时,我将其构建为应用程序的一部分。在我切换到 AndroidX 之前,一切都运行良好。
The app
模块将依赖关系声明为:
implementation project(path: ':some-lib', configuration: 'default')
如果我省略configuration: 'default'
声明依赖项时,我得到:
Unable to resolve dependency for ':app@enterprise/compileClasspath': Could not resolve project :some-lib.
Unable to resolve dependency for ':app@enterpriseUnitTest/compileClasspath': Could not resolve project :some-lib.
关于我在这里做错了什么有什么想法吗?