我有一个命令行 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模板网!
更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 IncompIncompatibleClassChangeError after updating to Android Build Tools 25.1.6 GCM / FCM(更新到 Android Build Tools 25.1.6 GCM/FCM 后出现 Incompatible
如何在 gradle 中获取当前风味How to get current flavor in gradle(如何在 gradle 中获取当前风味)
如何修复“意外元素<查询>在“清单How to fix quot;unexpected element lt;queriesgt; found in lt;manifestgt;quot; error?(如何修复“意外元素lt;查询gt;在“清单中找到错误
基于 Android Gradle 中多风味库的多风味应用Multi flavor app based on multi flavor library in Android Gradle(基于 Android Gradle 中多风味库的多风味应用)
Android 依赖在编译和运行时有不同的版本Android dependency has different version for the compile and runtime(Android 依赖在编译和运行时有不同的版本)
本地 aar 库的传递依赖Transitive dependencies for local aar library(本地 aar 库的传递依赖)