Every time edit build.gradle file Android studio will frozen - android

I am using Android studio 3.1 Canary 3 with gradle 4.3.1. It's very slow for me to visit maven.org, but when I edit build.gradle file in Android studio, it will send request to search.maven.org. As a result I must wait a minute or more for Android studio to response after edit build.gadle file, can anyone known how to fix it, I already try follow suggest:
1、Install Google Repository and Android support repository,
2、Set http and https proxy,
Setting http and https proxy works for me but still it is slow. While installing repository doesn't work at all, as the package is already installed before. So, I think preventing Android studio from sending request to search.maven.org is a good idea. If anyone known how to fix it, please let me known, thanks in advance.

It seems that this issue mainly happens in China. Every time when we edit build.gradle file Android studio will send request to search.maven.org then frozen and after the server response the request Android studio will unfrozen. So add 127.0.0.1 search.maven.org to hosts file can solve this issue, but sometimes we also need to visit search.maven.org.
For me, I am using Chrome with SwitchyOmega plugin installed so I first add 127.0.0.1 search.maven.org to /etc/hosts then add pac rule for this site in Chrome and I find everything work fine, Android studio will not frozen and I still can visit search.maven.org.

Related

Android Studio shows failed to prepare an update: request failed with status code 404

Whenever I try to update Android Studio it shows an error failed to prepare an update status code 404.. I have tried almost every possible way:
from changing no proxy to with proxy.
from reinstalling Android Studio to redownloading Android SDK.
from redownloading command-line-tools to changing operating system still no luck.
Even changed Android Studio version still the same error..
I did not found any similar question on web yet so I had to ask the question here. If anyone know any possible answer to solve this problem please tell me..
I am using Android Studio 3.6.3.
My PC is 32bit so I cannot download latest version. 32bit users are only receiving critical updates.
The problem started just two months before. Once I updated the Android Studio to 4.1 but now it is unable to do that.
Maybe to the site is not responding to the update request but other things are working properly like downloading SDK, NDK etc...

Gradle is not Syncing

I downloaded the Open-event-Android project of Fossasia from Github and imported it to Android Studio but I get this error "Error in Android Studio Plugin cannot be resolved from https://plugins.gradle.org/api/gradle because Gradle is running is offline mode "
like this
I don't know what is meant by "Gradle is running in offline mode". If it is saying that I am not connected to the internet, well I am using a proxy net and I have set the HTTP proxy to automatically detect.
I would appreciate any kind of help.
Did you try to deabilitate the offline mode?
there is a post that explains what to do. This could be a great way to start: checking if is enabled the offline mode.Or at least is what sound more reasonable to do as the error message say to you that cannot resolve from the link mentioned
Usually this happens when there's a plugin or some 3rd party library that's not available locally and it needs to connect to the internet for downloading and installing the same.

React Native demo project is failing due to gradle issue

Trying to setup the react native on Windows 7 as per instrcutions provided at https://facebook.github.io/react-native/docs/getting-started.html, after installing all the mandatory tools & dependencies, started getting below issue while running react-native run-android command.
Also looked at many options like setting up proxy for gradle etc but nothing seems to be worked till now.
Hope to get some quick help.
Are you sure it is not a temporary connection issue? Can you ping the server and get a response? Can you open the URL to the resource directly in your browser?

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

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

Android SDK beginner question

I'm a n00b developer at my second attempt to use the Android SDK. I'm
developing on the Mac platform and I've noticed that the latest
version of the SDK doesn't include anything except the tools (so I
have no plugins, no targets to choose from inside the package I
downloaded).
So I tried to use the Android SDK and AVD Manager to download and
install some, however, I got this error:
Failed to fetch URL https://dl-ssl.google.com/android/repository/
I went to the settings and checked the box to force fetching via HTTP,
but no result. I was suggested to look for a configuration file, but
couldn't find any.
Any suggestions? I'm dying to get my hands dirty with the SDK.
Whenever I've seen that error, I've just retried the download several times and eventually it went through. I've only run into it when I was behind a proxy, but that might not be your problem.
Here you have a Android tutorial, step by step.
http://www.vogella.de/articles/Android/article.html
Its means that you are behind a proxy.Go tools->options in your android SDK manager and enter your http Proxy server and port and it'll work.

Categories

Resources