Failed to import new Gradle project in android studio

前端 未结 11 1155
长发绾君心
长发绾君心 2020-11-29 23:46

I got the error when i create a new Project using android studio. below i attached a screenshots of error message..\"ent

相关标签:
11条回答
  • 2020-11-30 00:37

    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}

    0 讨论(0)
  • 2020-11-30 00:37

    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

    0 讨论(0)
  • 2020-11-30 00:38

    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

    0 讨论(0)
  • 2020-11-30 00:42

    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
    
    0 讨论(0)
  • 2020-11-30 00:44

    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.

    0 讨论(0)
提交回复
热议问题