androidproxyjcenter

I set a proxy in Android Studio but see a different port number in the logs than what I set


I set a proxy in Android Studio but see a different port number in the logs than what I set
The exibited port number is 8580 which is the port number of my previous VPN

I have to set another VPN because the previous one does not work properly
The port for the new VPN is 61121 and I checked the connection with the Check connection button there and it was ok
But it seems the Android Studio is yet set with my previous VPN

Following you could see the logs and settings:

enter image description here

Logs:

FAILURE: Build completed with 7 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform leakcanary-android-2.9.1.aar (com.squareup.leakcanary:leakcanary-android:2.9.1) to match attributes {artifactType=android-aar-metadata, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Could not download leakcanary-android-2.9.1.aar (com.squareup.leakcanary:leakcanary-android:2.9.1)
         > Could not get resource 'https://jcenter.bintray.com/com/squareup/leakcanary/leakcanary-android/2.9.1/leakcanary-android-2.9.1.aar'.
            > Could not GET 'https://jcenter.bintray.com/com/squareup/leakcanary/leakcanary-android/2.9.1/leakcanary-android-2.9.1.aar'.
               > Connect to 127.0.0.1:8580 [/127.0.0.1] failed: Connection refused: connect

Solution

  • I found the solution
    I beleive it's a Bug in Android Studio
    I changed the proxy settings in gradle.properties and the problem is solved now