我有2个模块的一个项目:一个应用程序(JAVA)与构建类型debug,release以及enterprise和科特林库(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.
对我在这里做错的任何想法吗?