{"id":351,"date":"2014-07-01T14:10:11","date_gmt":"2014-07-01T13:10:11","guid":{"rendered":"http:\/\/www.sebcharrot.com\/blog\/?p=351"},"modified":"2014-07-01T14:10:11","modified_gmt":"2014-07-01T13:10:11","slug":"gradle-behind-proxy","status":"publish","type":"post","link":"http:\/\/www.sebcharrot.com\/blog\/gradle-behind-proxy\/","title":{"rendered":"Using Gradle from behind a proxy"},"content":{"rendered":"<p>By default\u00a0Android Studio uses <a title=\"Gradle\" href=\"https:\/\/www.google.co.uk\/url?sa=t&amp;rct=j&amp;q=&amp;esrc=s&amp;source=web&amp;cd=1&amp;cad=rja&amp;uact=8&amp;ved=0CCAQFjAA&amp;url=http%3A%2F%2Fwww.gradle.org%2F&amp;ei=aKiyU-axLI6w7AaamoCwAg&amp;usg=AFQjCNH_UxWiB149nJy-OYLcJlagA0msqw&amp;sig2=80CGtymkuDDgicQD_WB0Pw&amp;bvm=bv.69837884,d.ZGU\" target=\"_blank\" rel=\"noopener noreferrer\">Gradle<\/a> to build Android\u00a0projects. This means Android Studio always needs a connection to the internet to\u00a0check for and retrieve dependencies. If you&#8217;re developing from behind a proxy (as I am) then you&#8217;ll have to explicitly tell Gradle the proxy details to allow it to connect to its servers.<\/p>\n<h2>Steps to fix<\/h2>\n<ol>\n<li>Navigate to the &#8220;.gradle&#8221; folder in your user directory (e.g. C:\\Users\\bob\\.gradle)<\/li>\n<li>Create a &#8220;gradle.properties&#8221; file<\/li>\n<li>Edit the file to have the following contents (replacing your own values)<\/li>\n<\/ol>\n<pre style=\"padding-left: 60px;\">systemProp.http.proxyHost=&lt;proxy_host&gt;\nsystemProp.http.proxyPort=&lt;port&gt;\nsystemProp.http.proxyUser=&lt;user&gt;\nsystemProp.http.proxyPassword=&lt;password&gt;\nsystemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost<\/pre>\n<p>Gradle should then succeed on the next build.<\/p>\n<p>Note &#8211; thanks go to <a title=\"Steven Hanson\" href=\"http:\/\/codetutr.com\/2013\/03\/27\/configuring-gradle-behind-a-proxy\/\" target=\"_blank\" rel=\"noopener noreferrer\">Steve Hanson<\/a> for these steps.<\/p>\n<p><strong>Update 08 Dec 2014<\/strong> &#8211; As of the update to Android 1.0, these steps are not enough! <a title=\"Gradle from behind a proxy, part deux\" href=\"http:\/\/www.sebcharrot.com\/blog\/2014\/gradle-from-behind-a-proxy-part-deux\">I&#8217;ve documented the new definitive list in this post<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default\u00a0Android Studio uses Gradle to build Android\u00a0projects. This means Android Studio always needs a connection to the internet to\u00a0check for and retrieve dependencies. If you&#8217;re developing from behind a proxy (as I am) then you&#8217;ll have to explicitly tell Gradle the proxy details to allow it to connect to its servers. Steps to fix&hellip;&nbsp;<a href=\"http:\/\/www.sebcharrot.com\/blog\/gradle-behind-proxy\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Using Gradle from behind a proxy<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"categories":[21],"tags":[28,91,93,95,142,162],"_links":{"self":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/351"}],"collection":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":0,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}