Gradle Received status code 403 from server: Forbidden

59.4k Views Asked by At

I can't build my android project due to this error. Gradle failed to GET https://www.jitpack.io/com/github/Raizlabs/DBFlow/dbflow/3.1.1/dbflow-3.1.1.pom . Strange enough I am able to view the pom file behind this URL in my browser. What might be the problem here?

My gradle.properties look like this:

systemProp.http.proxyHost=myproxy.local
systemProp.http.proxyPort=3210
systemProp.https.proxyHost=myproxy.local
systemProp.https.proxyPort=3210
systemProp.http.proxyUser=usr
systemProp.http.proxyPassword=pwd

When I remove the proxyUser/Password I get an 407 Proxy Authentication Required.

9

There are 9 best solutions below

2
On

Your proxy needs authentication and the authentication you supply is invalid or your proxy does not allow to request that URL with the authentication details you supply.

0
On

You've only provided user/password for systemProp.http. You likely need to provide the same for systemProp.https

See accessing the web via proxy

0
On

Check the local 'gradle.properties'. My problem was on there. Somehow there was some proxy informations and they was wrong. I deleted it and problem solved.

0
On

Upgrading to Android X can fix the Forbidden! response problem.

  • Open your project on Android Studio
  • Top menu > Refactor > Migrate to AndroidX
  • Don't forget backup your entire project before migrating.
1
On

You need to reset android studio because we cannot get the sever response due to proxy matters. Close Android Studio. Please Go to C://Users/Username/. Then delete .gradle file and .Android Studio File. After Open Android Studio and set settings. I solved this problem using above steps.

0
On

check gradle offline mode under settings and check local gradle then specify the path of you gradle.zip file its under

0
On

There is also a gradle.properties file in .gradle folder (on Mac it is in your home directory ~/.gradle/gradle.properties), check that for your proxy settings. That helped me. It is especially useful if your project level gradle.properties is shared with other developers via git.

0
On

Late answer, but useful, i suppose. I realised that it is not allowed to read jitpack artifacts from a private repository without having a paid subscription: https://jitpack.io/private

So that's might be a cause for 403 error. You have an option either upgrade or make the repository public Subscription must be bought for the repository's owner account.

0
On

For me this worked 1. Invalidate caches/restart 2. Sync project with gradle files