将本地Android支持库添加到Gradle构建中,而无需使用SDK Deployer添加到mavenLocal [英] Add local android support library to a gradle build without using SDK Deployer to add to mavenLocal
问题描述
无法使用SDK Deployer将库添加到 mavenLocal
中,我无法确定如何将Android支持库添加到Gradle构建中。主要问题是如何配置构建以使用本地文件系统上的位置来解析构建文件中指定的支持库依赖关系。
想通了。如果其他人试图做同样的事情,你需要在你的build.gradle文件中添加本地支持库位置到gradle build repositories
配置中,像这样(代入 path_to_sdk
,当然):
存储库{
。 ..其他存储库...
maven {
url'file:// path_to_sdk / extras / android / m2repository'
}
}
I'm having trouble figuring out how to add android support library to a gradle build, without using SDK Deployer to add the library to mavenLocal
. The main problem is how to configure the build to use the location on a local file system to resolve support library dependencies specified in the build file.
Figured this out. In case anyone else is trying to do the same, you need to add the local support library location to the gradle build repositories
configuration in your build.gradle file, like so (substituting path_to_sdk
, of course):
repositories {
... other repositories ...
maven {
url 'file://path_to_sdk/extras/android/m2repository'
}
}
这篇关于将本地Android支持库添加到Gradle构建中,而无需使用SDK Deployer添加到mavenLocal的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!