LoginSignup
24
21

More than 5 years have passed since last update.

Android StudioのProxy設定にハマったのでメモ

Posted at

目的

会社内の認証ありProxyが設定されているネットワークで
GradleのProxy設定に酷くハマったのでメモ

現象

jcenter.bintray.com から.pomを取得しようとすると
407 Proxy Authentication Required が返却される。

対策

1. Android Studio の System Settings で設定

Android Studio のPreferenceから
Appearance & Behavior > System Settings > HTTP Proxy
で値を入力して設定。
しかし407 Proxy Authentication Required エラーが発生。

2. gradle.propertiesに設定

Android プロジェクト内のgradle.propertiesに以下を設定。
systemProp.https.proxyHost
systemProp.https.proxyPort
systemProp.https.proxyUser
systemProp.https.proxyPassword

しかしこれでも407 Proxy Authentication Required エラーが発生。

3. User/ユーザー名/.gradle のgradle.propertiesに設定

User/ユーザー名/.gradle にもgradle.propertiesが存在していたので、開いてみると
systemProp.https.proxyPasswordが空になっていた。

ここにパスワードを設定してGradle syncを実行すると無事syncに成功。

結果

Proxyこわい

24
21
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
21