I have update Android Studio to latest version 3.1.1, but is so slowly , especially when I editing build.gradle file , is there any solution ? (before I use 3.0.1 , that is so fast)
This happens due to the fact that the module needs to be built from the scratch every time. Enable gradle Offline Work from Preferences-> Build, Execution, Deployment-> Build Tools-> Gradle. This will not allow the gradle to access the network during build and force it to resolve the dependencies from the cache itself.
In your build. gradle, if you have minifyEnabled for debug, remove it. I had it in my project and it took ~2-3 minutes to build.
It seems like this is only happening in China. Try this solution:
https://stackoverflow.com/a/47342580/501175
According to the answer above, there are two ways you can try:
127.0.0.1 search.maven.org
to the /etc/hosts file. I am using the second one and it works fine.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With