我有一个包含2个模块的项目:具有构建类型debug , release和enterprise的应用程序(Java)和该应用程序使用的Kotlin库( release和debug )。
我正在使用AndroidX,并且在gradle.properties中包含以下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.
对我在这里做错的任何想法吗?