问题描述
我有一个命令行 apk 生成器,它使用相同的源代码编译大量 APK,因此这些应用程序具有相同的依赖项.
I have a command line apk generator which compiles a lot of APKs using the same source code, so these apps have the same dependencies.
在 gradle 文档中我可以看到:
In the gradle documentation I can see this:
Gradle 项目需要网络连接才能下载依赖项.
The Gradle project needs network connectivity to download dependencies.
我知道可以将 gradle 配置为离线工作,而不是下载它为其他 apk 下载的相同依赖项.如何激活这种离线模式?
I know that it is possible to configure gradle to work offline and not download the same dependencies that it has downloaded for other apks. How can this offline mode be activated?
推荐答案
Gradle 在避免重新下载工件方面做得很好,但是你可以通过 --offline 到 Gradle 以防止在构建期间访问网络.
Gradle does a good job of avoiding re-downloading artifacts, but you can pass --offline to Gradle to prevent from accessing the network during builds.
例如
gradle --offline build
如果它需要网络中没有的东西,而不是尝试获取它,你的构建将会失败.
If it needs something from the network that it doesn't have, instead of attempting to fetch it, your build will fail.
这篇关于如何配置 gradle 以“离线"工作(使用缓存的依赖项)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!


大气响应式网络建站服务公司织梦模板
高端大气html5设计公司网站源码
织梦dede网页模板下载素材销售下载站平台(带会员中心带筛选)
财税代理公司注册代理记账网站织梦模板(带手机端)
成人高考自考在职研究生教育机构网站源码(带手机端)
高端HTML5响应式企业集团通用类网站织梦模板(自适应手机端)