Does Android studio need internet connection to build project

前端 未结 5 773
逝去的感伤
逝去的感伤 2020-12-02 14:56

I am using Android studio version 0.4.2 and gradle version 1.9. I have successfully installed Studio and have created multiple projects. Today when I launched Studio

相关标签:
5条回答
  • 2020-12-02 15:05

    In Android studio version 1.5.1 I could solve this error by following steps :

    1) Go to file -> Settings -> HTTP Proxy -> & select Auto detect proxy settings. 2) After that you may get Dialog to accept or reject certificate 3) Select Accept.

    That's it.

    0 讨论(0)
  • 2020-12-02 15:07

    For me, I had to check and then uncheck the box in

    Preferences->Gradle->Offline work.

    Then I got back online.

    0 讨论(0)
  • 2020-12-02 15:12

    There's an offline mode preference in Preferences > Compiler > Gradle. If you already have your dependencies downloaded, this will generally work for you.

    0 讨论(0)
  • 2020-12-02 15:16

    Currently Android Studio's Gradle implementation requires a fast stable network connection. For whatever reason, the developers have decided to force this requirement on users at this time. There is a setting that you should be able to use to utilize a local gradle installation, but it doesn't hold. The developers know about both the network requirement and the broken switch, but are currently prioritizing other functionality. They may remove that requirement in the 1.0 or post 1.0 time frame.

    [see: https://plus.google.com/u/0/115692564989237473252/posts/LGSbniYqj3Q ]

    Gradle's offline mode, isn't. It should be properly named cached mode. All that switch does is tell gradle to not try to go online and instead utilize cached copies of the various networked resources. Unfortunately that assumes that you have had (and will have again) a network connection, preferably a fast stable one. Using Android Studio (last version tested 0.5.9) with a slow/unstable network results in watching Android Studio process Gradle ( and Maven ) processes usually for 2-5 minutes, sometimes for 10 minutes or more. Also at seemingly random times when coding the IDE will lock up and the cause usually involves one or more Gradle processes that have spun up.

    As a comparison, using IntelliJ IDEA 13.1 Community edition (the IDE that Android Studio is based on) I compared a default "Hello Android" IDE generated program using the Android Gradle wizard (substantially similar to the only one in Android Studio) and the Ant based Android wizard. The results were as expected. The gradle based project experienced the same painful lock up and lag that projects in Android Studio exhibited. The ant based Android project was near instantaneous. No appreciable delay once the project was created and opened. Coding caused no random lockups. Testing was done on a Windows 8.1 update1 Pro machine with a dual Athlon x2 processor, 6GB RAM, and a 6Mb/0.75Mb DSL connection. I believe that last part is most likely the issue.

    Unfortunately until Android Studio removes the network requirement I feel it will be unusable to a large number of developers. That's a shame because otherwise it looks to be a marked improvement over the existing Eclipse based development environment.

    0 讨论(0)
  • 2020-12-02 15:27

    You can download the gradle distribution locally and build the project again.

    To do this, edit your gradle-wrapper.properties under gradle-> wrapper in your Android project.

    Edit the

    distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip

    to

    distributionUrl=file:///home/foo/downloads/gradle-2.2.1-all.zip

    So just download the file from here as mentioned in your gradle-wrapper.properties.

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