Reputation: 13
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.3/gradle-4.1.3.jar'. Received status code 405 from server: Method Not Allowed Disable Gradle 'offline mode' and sync projectenter image description here
Upvotes: 1
Views: 751
Reputation: 1
I was facing a similar issue with my Android Studio. This is happening due to a bad link in moven, In my case, I was using the given link which is not reachable now and giving 502 error.
maven {
url 'http://dl.bintray.com/amulyakhare/maven'
}
Solution:- I have commented on my maven link and Sync my Gradle now it's working.
// maven {
// url 'http://dl.bintray.com/amulyakhare/maven'
// }
Explanation: if you are using any such link in your build.gradle
then try to rectify from error. Comment your block of code and resync.
Upvotes: 0
Reputation: 15557
Make sure you do not have gradle offline mode enabled. Your gradle toolbar should look like the one below. The 4 icon from the left, is the toggle offline/online button. It should not be selected.
You can run the actions like the following to do a gradle sync with your project.
That should get you back online and your project synced up.
Upvotes: 1