LoginSignup
4
4

More than 5 years have passed since last update.

認証プロキシ環境下でIntelliJ IDEAを用いてandroidアプリをビルドする

Posted at

社内プロキシ環境下で、androidアプリのビルドに苦戦したのでメモ

どれが有効か切り分けができていないので、試したことをすべて載せます。

①IntelliJ IDEAの設定

IntelliJ IDEAのトップから「Configure」 → 「Setting」
設定1.png

HTTP Proxyの設定から「Manual proxy configuration」を設定
設定2.png

②ユーザーディレクトリ配下のgradle.propertiesの設定

以下を追記

[ユーザーディレクトリ]/.gradle/gradle.properties
systemProp.http.proxyPassword=***
systemProp.http.proxyHost=***
systemProp.https.proxyPort=***
systemProp.https.proxyUser=***
systemProp.https.proxyPassword=***
systemProp.https.proxyHost=***
systemProp.http.proxyPort=***
systemProp.http.proxyUser=***

③プロジェクト内のgradle.propertiesの設定

以下を追記

[プロジェクトディレクトリ]/gradle/wrapper/gradle-wrapper.properties
systemProp.http.proxyPassword=***
systemProp.http.proxyHost=***
systemProp.https.proxyPort=***
systemProp.https.proxyUser=***
systemProp.https.proxyPassword=***
systemProp.https.proxyHost=***
systemProp.http.proxyPort=***
systemProp.http.proxyUser=***

④gradlewファイルの設定

先頭(#!/usr/bin/envの下)に以下を追記

[プロジェクトディレクトリ]/gradlew
set JAVA_OPTS=-DproxyHost=*** -DproxyPort=*** -Dhttp.proxyUser=*** -Dhttp.proxyPassword=*** -Dhttps.proxyUser=*** -Dhttps.proxyPassword=***

⑤「Could not determine Java version using executable」への対処

gradleのバージョンが合っていないことが原因らしい
以下の行を書き換えてgradleのバージョンを変更する

[プロジェクトディレクトリ]/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip

参考

4
4
0

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
4
4