So I just installed Android Studio again after a long time and it asked me to configure the proxy, so I did. I tested the connection and it worked.
Then it asked me
In my case, I verified that in File > Settings> HTTP proxy, I had checked the "no proxy" option. Then I created an exception in my antivirus for Android Studio, and deleted the lines of proxy configuration of my gradle.properties file. Finally, I clicked on Sync Project with gradle files and it worked.