颤音 - 如何阻止扑飞反复下载gradle zip文件并解决良好的依赖关系
升级到Flutter 3.0后,这个问题再次困扰着我。
当它反复保持重新下载gradle zip文件以及所有这些JAR和POM文件时,我会厌倦了在多个设备上运行的flutter应用程序,只是因为它遇到了一个错误,仅由于其无反应服务所引起的Internet连接不佳,而不是我的我的我的我,而不是我的。互联网。
我无法忍受它会在一次不良的Internet连接问题的单一事件上继续添加一半的Gigabytes文件,如果再次出现错误,则再次进行此操作,就像我以前下载的所有内容不再可用一样。
对于Gradle,我知道如何手动执行此操作,例如通过运行gradlew - Offline build
并手动安装文件,但是如果资源安装通过Flutter完全处理,我不知道该如何执行相同的操作因为在构建应用程序时解决依赖项上发生错误。
This issue started haunting me again after upgraded to Flutter 3.0.
I getting tired with running Flutter app on multiple devices when it repeatedly keeps redownloading Gradle zip file and all those jar and pom files just because it encounters one error that occurred only because of the poor internet connection which is caused by their unresponsive server, not my internet.
I can't stand seeing it keeps redownloading a half of gigabytes files on a single occurance of poor internet connection issue, and do it again if there's error again, like everything I've downloaded before are no longer usable.
For Gradle, I know how to do it manually for example by running gradlew --offline build
and install the files manually, but i have no idea how to do the same if the resources installation fully handled by Flutter because the error occur on dependencies resolving while building the app.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经能够通过手动更改来解决Gradle问题
gradle-wrapper.properties
。您需要在
DistributionUrl
的末尾使用zip
文件,其中包含已经下载的Gradle发行版。例如,使用
gradle-7.5.1.zip
:distributsurl = https \: //services.gradle.org/distributions/gradle-7.5.1.zip
>您可以在默认文件夹
c:\ users \ $ user \ .gradle \ .gradle \ wrapper \ dists
中查看所有Gradle版本。如果主文件夹中没有一个
.zip
文件,则必须检查所有子文件夹并在主文件夹中复制它或自己下载。不幸的是,这仅适用于Gradle发行版,无法避免下载新的依赖项。由于全部由Flutter Package Manager处理。
I've been able to solve the Gradle problem by manually changing the
gradle-wrapper.properties
.You need to change the Gradle version at the end of the
distributionUrl
with azip
file that contains an already downloaded Gradle distribution.For example, this case with a
gradle-7.5.1.zip
:distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1.zip
You can check all your Gradle versions in the default folder
C:\Users\$USER\.gradle\wrapper\dists
.If there is not a single
.zip
file in the main folder, then you have to check all the sub-folders and copy-paste it in the main folder or download it yourself.Unfortunately this is only for Gradle distributions, there is no way to avoid downloading new dependencies. Since is all handled by the flutter package manager.