background
After trying Flutter for the first time, I got stuck for half a day
solve
I have tried other people's solutions, but
they are not very easy to use. How do I do it? Look down:
Under the project root directory, open android
the directory, and click on the configuration file. gradle.properties
Here are two solutions:
Method 1: Configuring Mirroring
maven={ url 'https://maven.aliyun.com/repository/public' }
Method 2: Configure proxy
http[s] proxy configuration, choose by yourself
systemProp.http.proxyHost=127.0.0.1
systemProp.http.proxyPort=10809
systemProp.https.proxyHost=127.0.0.1
systemProp.https.proxyPort=10809
If there is a user name and password, don’t forget to add it, if not, don’t add it
systemProp.http.proxyUser=your_username
systemProp.http.proxyPassword=your_password
systemProp.https.proxyUser=your_username
systemProp.https.proxyPassword=your_password
If you use the SOCKS5 protocol, just replace the word http[s]:
systemProp.socks5.proxyHost=your_proxy_host
systemProp.socks5.proxyPort=your_proxy_port
Roughly the same as http[s]
other
You can choose whether to close the Gradle daemon (daemon)
The Gradle daemon is a resident Gradle process in the background, which can shorten the build time and improve build performance, because it can cache loaded plugins and dependencies to avoid reloading every time you build. By default, the Gradle daemon is enabled
. But in some cases you may wish to turn it off, for example:
- The build script or plugin is incompatible with the Gradle daemon, causing the build to fail.
- Computer resources are limited and cannot support additional processes or threads.
- Want to avoid some problems caused by the Gradle daemon, such as memory leaks, process unresponsiveness, etc.
If you want to shut down the Gradle daemon, just add the following code to the Gradle configuration file (such as gradle.properties):
org.gradle.daemon=false
Note that turning off the Gradle daemon may result in longer build times, as plugins and dependencies need to be reloaded for each build
Simply put, small projects are turned off and enterprise projects are turned on