AGP Gradle 的一些问题记录
7.0.4 版本环境, as: Build #AI-211.7628.21.2111.8139111, built on February 2, 2022
allprojects {
configurations.all {
resolutionStrategy.dependencySubstitution {
//project&module依赖关系切换处理
substitute(project(":--hw_modules:lib_motherboard_Haitianxiong")) using(module("cn.mashang.hw_modules:lib_motherboard_Haitianxiong:1.1.5")) //正确的
//substitute(module("cn.mashang.hw_modules:lib_motherboard_Haitianxiong:1.1.5")) using(project(":--hw_modules:lib_motherboard_Haitianxiong")) 错误的
}
}
}
错误提示,看起来很蒙逼,我灵机一动切换过来的
Could not determine the dependencies of task ':VScreen:compileVscreen_baseDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':VScreen:vscreen_baseDebugCompileClasspath'.
> Could not resolve cn.mashang.hw_modules:lib_motherboard_Haitianxiong:1.1.5.
Required by:
project :VScreen
> No matching configuration of project :--hw_modules:lib_motherboard_Haitianxiong was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute '220211' with value 'vscreen_base' but:
- None of the consumable configurations have attributes.
具体原因应该是版本改动