I’m trying to get Gradle to resolve dependencies behind a NTLM proxy and I’m having trouble. I’m working with Android Studio and have tried all possible solutions including a gradle.properties file, a maven settings.xml file, configuring the proxy in Gradle settings and so on. I’ve seen a couple of post from a year ago with people describing the same problem but they don’t seem to be resolved. Is this still an issue with Gradle or is there a known workaround? The current error I’m getting is:
NEGOTIATE authentication error: Invalid name provided (Mechanism level: Cannot locate default realm)
Thanks in advance and let me know if you have any questions.
Which exact solutions have you tried? Have you checked “20.2.1. NTLM Authentication” in the Gradle User Guide?
Hi Peter,
Thanks for responding. I have tried setting the ‘systemProps’ in gradle.properties. I’ve also tried adding the ‘-Dhttp’ properties in the Gradle VM options under AndroidStudio->Preferences->Gradle.
For both examples I’ve tried setting ‘*.auth.ntlm’ property to the domain and I’ve also tried just using the ‘domain/username’ configuration both don’t seem to work.
To give some more info, right now I’m trying to compile the crashlytics jar from their website. I’ve added the following line
maven { url 'http://download.crashlytics.com/maven' }
to my buildscript in both places. I added the line
compile 'com.crashlytics.android:crashlytics:1.1.11'
to my dependencies. When I try to get the project to build I get the following error:
> Could not download artifact 'com.crashlytics.android:crashlytics:1.1.11:crashlytics.jar'
> Could not GET 'http://download.crashlytics.com/maven/com/crashlytics/android/crashlytics/1.1.11/crashlytics-1.1.11.jar'. Received status code 500 from server: ruleengineerror
If you receive a 500 (internal server error) saying “ruleengineerror”, you are likely hitting a problem on the proxy or Maven repo side, not a problem on Gradle’s side. I recommend to contact your admin to troubleshoot this.
I thought that too, but if I paste the link into a browser it works fine. Do you know why that might be?
Perhaps the browser is automatically configured in the right way in your environment. But again, your admin will know better.