Today I updated Android studio from 3.0.1 to 3.1.
I encountered a weird issue with Gradle. Each time I tried to edit a .gradle file, Android Studio freezes.
With some research, I saw that each time you edit a .gradle file, Android Studio send a request to search "http://search.maven.org/".
I'm behind a proxy at my work, everything is configured, everything worked properly before that update.
Is anyone encountered the same issue with this version or a older one?
Although the Android plugin is typically updated in lock-step with Android Studio, the plugin (and the rest of the Gradle system) can run independent of Android Studio and be updated separately. For the best performance, you should use the latest possible version of both Gradle and the plugin.
For this, you have to connect your PC to the internet and you have to open your Android studio. After opening your project click on the Sync Project with Gradle files option. This will automatically download the new Gradle files and will fix the issue which is caused by the Gradle files.
jcenter is having issues so when you get your project to build correctly the once enable offline-mode so AS don't have to connect to jcenter every gradle refresh.
see this question for more info.
It is always good to check idea.log to see if there are any errors. On Mac OS X you can use "Help" > "Show Log in Finder" to show the idea.log file.
For my case, I found errors below, where my proxy was failing because I have just changed my password. After I updated my password, the freezing issue went away.
WARN - roid.inspections.LintIdeClient - Could not connect to maven central to look up the latest available version for com.google.android:flexbox:+
WARN - roid.inspections.LintIdeClient - Could not connect to maven central to look up the latest available version for com.google.android:flexbox:+
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