Programing

AndroidStudio Gradle 프록시

lottogame 2020. 12. 14. 07:42
반응형

AndroidStudio Gradle 프록시


실행하려고했지만 부팅시 오류가 발생합니다.AndroidStudio
gradle

Failed to import Gradle project: Connection timed out: connect

여기 에서 해결책을 찾았 습니다.

하지만 .NET에서이 속성을 설정하는 방법을 찾을 수 없습니다 Android Studio.

설정 graddle-wrapper.properties은 도움이되지 않습니다.


Android Studio-> Preferences-> Gradle에서 프록시 세부 정보를 VM 옵션으로 전달합니다.

Gradle VM 옵션 -Dhttp.proxyHost=www.somehost.org -Dhttp.proxyPort=8080

* 0.8.6 베타 Gradle은 파일-> 설정 (Windows 및 Linux의 경우 Ctrl + Alt + S)에 있습니다.


gradle.properties파일 (프로젝트 루트 디렉토리)로 이동하여이 옵션을 추가하십시오.

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=user
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=localhost
systemProp.http.auth.ntlm.domain=domain

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=user
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=localhost
systemProp.https.auth.ntlm.domain=domain

Android Studio 3.2 (Windows)의 경우 현재 사용자 용으로 gradle.properties파일을 편집 할 수 있습니다 C:/Users/USERNAME/.gradle.

참조 이미지


NTLM 인증 프록시의 경우 :

파일-> 설정-> 프로젝트 설정-> Gradle-> 전역 Gradle 설정-> Gradle VM 옵션

-Dhttp.proxyHost=myProxyAddr -Dhttp.proxyPort=myProxyPort -Dhttp.proxyUser=myUsername -Dhttp.proxyPassword=myPasswd -Dhttp.auth.ntlm.domain=myDomainName

gradle.properties 파일 (프로젝트 루트 디렉터리)

http 및 https에 대한 프록시를 설정해야합니다.

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=user
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=localhost
systemProp.http.auth.ntlm.domain=domain

systemProp.https.proxyHost=www.somehost.org
systemProp.https.proxyPort=8080
systemProp.https.proxyUser=user
systemProp.https.proxyPassword=password
systemProp.https.nonProxyHosts=localhost
systemProp.https.auth.ntlm.domain=domain

파일-> 설정-> HTTP 프록시 (IDE 설정 아래)에서 프록시를 설정하면 http 프록시 만 정의하고 https 프록시는 설정하지 않습니다.


Rajesh의 제안은 저에게 효과가 없었습니다. 내가 한 일은

파일-> 설정-> HTTP 프록시 (IDE 설정 아래)-> 수동 프록시 구성

Rajesh가 제안한 것처럼 Gradle 아래의 Project Settings에 프록시 정보를 남겨 두었습니다. 그러나 나는 그것이 필요한지 완전히 확신하지 못합니다.

0.8.6 베타를 사용하고 있습니다.


In my case I am behind a proxy with dynamic settings.

I had to download the settings script by picking the script address from internet settings at
Chrome > Settings > Show Advanced Settings > Change proxy Settings > Internet Properties > Connections > LAN Settings > Use automatic configuration script > Address

Opening this URL in a browser downloads a PAC file which I opened in a text editor

  • Look for a PROXY string, it should contain a hostname and port
  • Copy values into gradle.properties

systemProp.https.proxyHost=blabla.domain.com
systemProp.https.proxyPort=8081

  • I didn't have to specify a user not password.

For Android Studio 1.4, I had to do the following ...

In the project explorer window, open the "Gradle Scripts" folder.

Edit the gradle.properties file.

Append the following to the bottom, replacing the below values with your own where appropriate ...

systemProp.http.proxyHost=?.?.?.?
systemProp.http.proxyPort=8080
# Next line in form DOMAIN/USERNAME for NTLM or just USERNAME for non-NTLM
systemProp.http.proxyUser=DOMAIN/USERNAME
systemProp.http.proxyPassword=PASSWORD
systemProp.http.nonProxyHosts=localhost
# Next line is required for NTLM auth only
systemProp.http.auth.ntlm.domain=DOMAIN

systemProp.https.proxyHost=?.?.?.?
systemProp.https.proxyPort=8080
# Next line in form DOMAIN/USERNAME for NTLM or just USERNAME for non-NTLM
systemProp.https.proxyUser=DOMAIN/USERNAME
systemProp.https.proxyPassword=PASSWORD
systemProp.https.nonProxyHosts=localhost
# Next line is required for NTLM auth only
systemProp.https.auth.ntlm.domain=DOMAIN

Details of what gradle properties you can set are here... https://docs.gradle.org/current/userguide/userguide_single.html#sec%3aaccessing_the_web_via_a_proxy


For the new android studio 1.2 you find the gradle vm args under:

File
- Settings
  - Build, Execution, Deployment
    - Build Tools
      - Gradle

If you are at the office and behind the company proxy, try to imports all company proxy cacert into jre\lib\security because gradle uses jre's certificates.

Plus, config your gradle.properties. It should work

More details go to that thread: https://groups.google.com/forum/#!msg/adt-dev/kdP2iNgcQFM/BDY7H0os18oJ


If build failed due to gradle proxy setting then simply putting my proxy IP address and port number will solve. It worked for me. File -> setting -> http proxy -> manual configuration -> Host name: your proxy IP, port number: your proxy port number.


The following works for me . File -> Settings -> Appearance & Behavior -> System Settings -> HTTP Proxy Put in your proxy setting in Manual proxy configuration

Restart android studio, a prompt pops up and asks you to add the proxy setting to gradle, click yes.

참고URL : https://stackoverflow.com/questions/18443208/androidstudio-gradle-proxy

반응형