Hardik Nadiyapara
Hardik Nadiyapara

Reputation: 2446

Failed to import new Gradle project in android studio

I got the error when i create a new Project using android studio. below i attached a screenshots of error message..enter image description here I am using windows 7 (64 bit) Please help me.

Upvotes: 35

Views: 90567

Answers (11)

rookiejava
rookiejava

Reputation: 149

Check your proxy setting for gradle. If it still fails after set the HTTP Proxy in setting menu, you may add gradle.properties as following.

First, go to the project directory. (By default-for Windows-, projects will be created to {user}\AndroidStudioProjects\{ProjectName}). And then create gradle.properties file as below.

systemProp.http.proxyHost=www.somehost.org
systemProp.http.proxyPort=8080
systemProp.http.proxyUser=userid
systemProp.http.proxyPassword=password
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost

you can also refer to the User's guide.

Upvotes: 0

Vivek Mishra
Vivek Mishra

Reputation: 352

  1. First Create a New Project "your_project"
  2. When the above stated error appears click ok
  3. Now go to IMPORT-> "your_project " and follow the instruction
  4. Your Project Is Created

Upvotes: 10

Tad
Tad

Reputation: 4784

In my case, it was sufficient to specify the location of the Gradle distribution included with Android Studio when requested.

On a mac, it was: /Applications/Android Studio.app/Contents/gradle/gradle-2.2.1
On Linux, it can be generalized to {android-studio-root}/grade/gradle-{version}

Upvotes: 28

user456118
user456118

Reputation:

I also had an issue downloading gradle through AndroidStudio. I tried the following.

  1. Go to your AndroidStudio directory where you installed your studio Like D:\User\AndroidStudio
  2. In AndroidStudio go to \AndroidStudio\plugins\gradle\lib and copy gradle.jar
  3. Paste gradle.jar file in \AndroidStudio\lib directory.
  4. Download gradle directly from Gradle
  5. Copy the contents of gradle-1.6-bin.zip - After extracting zip file - (bin, media, init.d, lib folders) to \AndroidStudio\plugins\gradle
  6. Restart AndroidStudio

* Updated Answer *

And after following all the steps listed above, if it is not working, Kindly check below things.

1) Please delete .gradle folder from your user like C:\Document and Settings\AndroidUser\***\.gradle

2) You can check your HTTP Proxy in Settings.

Hope this helps!

Upvotes: 32

Bilbo Baggins
Bilbo Baggins

Reputation: 3692

While importing the project I specified the location of the Gradle distribution.

On Windows 7 it was here:

C:\Program Files\Android-Studio\gradle\gradle-2.2.1

Upvotes: 0

Alex Perevozchykov
Alex Perevozchykov

Reputation: 2501

If Android Studio offers you to choose home folder for gradle, just choose "Use customizable gradle". Then, if you see only gradle files, but no classes and resources - click on "Synchronize gradle" and it will be alrigth. Hope this helps

Upvotes: 2

user2006905
user2006905

Reputation: 21

Had the same problem I think because our internet set-up blocked access to https://dl-ssl.google.com site.I resolved in by downloading gradle 1.6 zip then extracted it in some folder.go to File --> Settings --> click option-->Gradle ,the check use local gradle distribution and point it to the extracted directory eg C:\android-studio\plugins\gradle\gradle-1.6-bin\gradle-1.6 Then it was okay

Upvotes: 1

Fernando Fernandez
Fernando Fernandez

Reputation: 11

If you using ubuntu behind a proxy, in my case I'm using ctlm, you must change the jetbrains' proxy setting in /Home/UserName/.AndroidStudioPreview/config/options/other.xml

<option name="USE_HTTP_PROXY" value="true" />
<option name="PROXY_HOST" value="localhost" />
<option name="PROXY_PORT" value="8080" />

This is my configuration I don't need autentificated user.

bests Regards

Upvotes: 1

Muhammad Hewedy
Muhammad Hewedy

Reputation: 30078

Download gradle, and replace it with the file gradle-1.6-bin.zip located at: C:\Users\<username>\.gradle\wrapper\dists\gradle-1.6-bin\<some_hash_key>\

Upvotes: 4

TomS
TomS

Reputation: 511

For me, this issue only occurs when using a proxy server. If you specify a proxy server in the settings, everything is working fine for me. You can specify a proxy server by File->Settings->HTTP Proxy

Upvotes: 1

prashanthaku
prashanthaku

Reputation: 13

We have to change the android sdk source in the project settings to our sdk where we have installed the android build tools.

I had the same issue and by doing this, it worked. Thanks.

Upvotes: 0

Related Questions