Android-Studio: Gradle projects won't build without internet connectivity even in "Offline Mode"

StackOverflow https://stackoverflow.com/questions/23226804

Вопрос

I've recently shifted to Android-Studio from Eclipse simply because of it's automatic code completion feature which I fell in love with. But Android Studio is giving me a hard time from the moment I installed. It is laggy, it freezes often, but the main problem is that it does NOT build my projects without connecting to the internet. I found this question where I found that we can build gradle projects without connecting it to the internet by enabling the "Offline Mode" but it doesn't work for me. Even if I set gradle to local distribution mode, Android Studio automatically changes it to default settings, which is really annoying. I've no idea what's wrong with Android Studio. I'm using version 0.4.6.

The event log shows this -

11:13:26 PM AssertionError: Already disposed: Already disposed
11:13:42 PM Failed to refresh Gradle project 'Study Buddy'
        Unknown host 'repo1.maven.org'.
        Please ensure the host name is correct. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle.
        HTTP proxy settings Open Gradle documentation

However, when I connect to the internet gradle builds the projects without any error. But I want to use Android-Studio in Offline Mode since I've a really low bandwidth. Please help to fix this issue.

Это было полезно?

Решение

Offline mode works only after you've compiled one time online. I know, it doesn't make complete sense if you don't understand everything on how Gradle works. But, you have to compile one time online and then it works.

This of course is a moot point if you don't have access to an internet connection at the time you wish to compile. Or, if you're like me, it just doesn't work due to your company's proxy and firewall rules.

I did get it to work at my company but the latest upgrade broke it. And now, even the previous version doesn't work, but I think that was my company as well. They pushed out some "patches" and I think that's what broke it.

Другие советы

You should upgrade. Offline support has improved since 0.4.6; it's mentioned in the 0.5.0 release notes: http://tools.android.com/recent/androidstudio050released

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top