【发布时间】:2022-01-21 18:44:17
【问题描述】:
我有一个带有库依赖项的 android 应用程序,我希望将其替换为 composite builds 中所述的本地项目
build.gradle(模块:MyApp.app)
dependencies {
implementation 'com.github.myname:lib_project_name:dev-SNAPSHOT'
}
settings.gradle(项目设置)
include ':app'
includeBuild('../lib_project_name') {
dependencySubstitution {
substitute module('com.github.myname:lib_project_name') using project(':')
}
}
lib 项目由两个子项目(一个示例应用程序和 lib 本身)组成
settings.gradle(项目 lib_project_name)
include ':app'
include ':lib'
将项目与 gradle 文件同步后,lib 在 Android Studio 中显示为子项目,但 gradle 通过警告
Unable to resolve dependency for ':app@debug/compileClasspath':
Could not resolve com.github.myname:lib_project_name:dev-SNAPSHOT.
有什么办法解决这个问题吗?
【问题讨论】:
标签: android gradle dependencies composite