我有一个包含 2 个模块的项目:一个具有构建类型debug
、release
和的应用程序 (Java) 以及该应用程序使用enterprise
的 Kotlin 库 (release
和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
我的settings.gradle
:
include ':app',':some-lib'
project(':some-lib').projectDir = file ('../some-lib/lib')
库模块最终将成为这个应用程序和其他应用程序使用的它自己的库,但是当我在处理它时,我将它构建为应用程序的一部分。在我切换到 AndroidX 之前,一切都很好。
该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.
关于我在这里做错了什么的任何想法?