How to solve this error in android studio 2.2.3 - android

Error:Unknown host 'jcenter.bintray.com'.
You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync projectLearn about configuring HTTP proxies in Gradle

Your firewall should allow Android Studio, Gradle Dependency end points. Since it can't reach the url & download the dependencies giving the error Unknown Host.
Hope this will help.

Related

gradle 3.2 failed to sync in android studio 3.2

i just downloaded the android studio 3.2 and it cannot sync my new project gradle.
i m using a proxy and i entered the proxy details in setting too. but i get this error:
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.0/gradle-3.2.0.pom'. Received status code 407 from server: Proxy Authentication Required
Enable Gradle 'offline mode' and sync project
i downloaded the file with google chrome.
when i use the 'offline mode' in gradle , i get this error:
No cached version of com.android.tools.build:gradle:3.2.0 available for offline mode.
Disable Gradle 'offline mode' and sync project
what should i do?
i added this proxy details to the gradle.properties and it worked.
if you wanna find gradle.properties go to C:\Users\youruser.gradle and you find it.
systemProp.http.proxyPort=your port
systemProp.http.proxyUser=vpn username
systemProp.http.proxyPassword=vpnpass
systemProp.https.proxyPassword=vpn pass
systemProp.https.proxyHost=vpn ip
systemProp.http.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.http.proxyHost=vpn ip
systemProp.https.proxyPort=your port
systemProp.https.nonProxyHosts=*.nonproxyrepos.com|localhost
systemProp.https.proxyUser=vpn username
sometimes if you use your username and password in android studio setting, it doesn't work.
///////////
*****first check if the android studio can use your proxy without giving it the information.you can check the (no proxy) box in setting>appearance and behavior>system setting>http proxy, and try to rebuild the project
Go to :
File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle
And then uncheck the offline work.
If you have idea on running offline mode do this.
Go to folder that you have already created project (build using online mode) for example C:\users\user\AndroidStudioProjects\project1.
After that create a new project in Android Studio. And build it in offline mode.
It shows same error. Now copy the .gradle and app folderfrom first project folder to second project folder.
Now build and sinc project it will run perfectly.
For this you should have atleast one "Hello World" project already build using online mode. After that copy this for all other projects.

Sync fail in android studio

Unknown host 'maven.parse.com'.
You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
getting this error and not build project
also not visible Run icon. Please check this image
Go to File->Settings
Search For Gradle in the search box and then uncheck the Offline work checkbox and then try to sync project.

Unable to create & sync android project in mac with android studio 3.1.4

Unknown host 'jcenter.bintray.com: nodename nor servname provided, or not known'. You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
if I do it in offline mode getting different errors
these are my gradle files tried different build tool versions in last few days but non working please help.

Android Studio Error : Unknown Host 'service.gradle.org'

I was working on a project on Android Studio 3.0 Beta 2 when suddenly i get the following error in my console:
Error:Unknown host 'service.gradle.org'. You may need to adjust the proxy settings in Gradle.
Enable Gradle 'offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
I haven't made any changes to my gradle. I have tried invalidating caches and restarting Android Studio to no avail. I have restarted my computer as well but still no luck.
What's causing this to show up and how can i solve this?
I realized there was a typo and was supposed to be services.gradle.com instead of service.gradle.com. I don't know how this happened since the gradle-wrapper.properties file wasn't open but that was the issue.

Gradle is failing on syncing my project in the new Android Studio 2.0

I have just upgraded (i.e., installed a full new version) my Android Studio from 1.5 to 2.0. The upgrade seemed to go smoothly, but I am having trouble with my project when I open it, when Gradle is syncing my project.
After Gradle sync runs for a couple of minutes I get this error:
Failed to sync Gradle project MyProject
Unknown host 'jcenter.bintray.com'. You may need to adjust the proxy settings in Gradle.
Error: Enable Gradle "offline mode' and sync project
Learn about configuring HTTP proxies in Gradle
So, I click on the link that says:
Enable Gradle "offline mode' and sync project
Then Gradle spins for a second or two, and I now have this message:
Failed to sync Gradle project MyProject
Error: No cached version of com.android.tools.build:gradle:1.3.0 available for offline mode.
Disable Gradle 'offline mode' and sync project
So, I click on this link:
Disable Gradle 'offline mode' and sync project
And I am back to my first error again.
The machine I am working on is 100% off line. It does not have, nor will it ever have any kind of network connection whatsoever. I figure I need to disable some kind of check that requires the internet, but I am not sure what. Is this fixable, or do I have to downgrade back to Android Studio 1.5?
UPDATE
I am also getting this error message:
Gradle sync failed: Unknown host 'services.gradle.org'. You may need to adjust the proxy settings in Gradle.
Ok, I fixed my issue so I wanted to post how I did it in case somebody else runs into this situation.
I was googling around and found a statement regarding working offline with Android Studio that read:
You can, however you won't be able to use any Gradle dependency. Gradle search into the repositories for dependencies using internet, so if you're completely unable to work online. Try not to include anything in the Gradle files, if you do, you'll have to sync it and it'll fail. Bascially just don't touch Gradle files and you'll be good to go.
So, I looked at my gradle files, specifically the build.gradle for the Project (not for the Module). Once there, I noticed a line:
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
}
So, I replaced 1.3.0 with 2.0.0 and the project built just fine.
I hope this helps somebody else in the future. Good luck.
I got same problem when I downloaded "BackboneExampleApp" source code from guithub Click Here For Code. I have done following process by watching settings of my old projects and found these errors. I resolved both errors, run my app and got errors to upgrade project and finally when I updated then no more problems exist. Just see pictures for help.
build.gradle (Project:BackboneExampleApp-master)-->
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
}
I also come with the same problem in my application. I have Done invalidate caches/restart then the problem is resolved.
I had the same problem as yours. Fortunately, I managed to solve it. You need to go to File >> Settings >> Build, Execution, Deployment >> Build Tools >> Gradle. You need to change the Gradle Home. Mine was "C:/Program Files/Android/Android Studio/gradle/gradle-2.08" and it said the path is invalid. So, just recheck your path in your file explorer and change it. I changed mine to "C:/Program Files/Android/Android Studio/gradle/gradle-2.10".
I had a similar problem. I was trying to build one of the media samples. I tried to use gradle 2.0.0 as you suggested but it didn't work. Got me on the right track though. gradle 2.1.0, along with deactivating offline mode got it to work.
For me it was a connection issue, that I have checked my connection is working in the same second I have enabled and disabled offline Gradle, then Android Studio download the needed files
NB: My Connection was disconnecting and reconnecting many times, so i figured out that this error was caused by the connection specially it was not the same time it takes when trying to sync my Gradle
For those have issues with error message: Learn to configure HTTP settings, below is the solution that worked for me. Am using Android studio 2.3.3:
Go to http://developer.android.com/studio/intro/studio-config.html
Step 1: Follow the instructions on: Set up Android studio proxy.
Step 2: Follow the instructions on : Android plugin for gradle HTTP proxy setting. You will see proxy settings under : # project wide gradle settings, copy the code there and paste it into the empty space in gradle properties file which is under the build gradle in Android studio. Make sure you are connected to internet while on this process. Wait until the the error disappears.
Step 3: you may see another message pop up stating: some folders may have been missing syn now. Just click on syn now.
I hope this help, thanks all.
I was fallen the same trouble, you mentioned. But I solved it myself. I connected my pc to the internet and rebulit the project using PROJECT>>REBUILT PROJECT.
Then some downloads could be seen below with the name of jcenter.......
THEN THE PROBLEM SOLVED...😃
Gradle build became successful..
I faced the same issue. Make sure that you have made an entry in path in environment variable for gradle
C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin
After disable offline mode and setting the path in environment variables, the issue was fixed and Gradle was build cleanly.
It seems there are multiple reasons for this issue. I fixed it by changing the "Gradle version" and "Android plugin version".
It might be helpful to someone. Go to File->Project Structure. Select Project and update your gradle and android plugin versions.
I also came with the same problem in my application..The application Gradle version is 2.3.3 .I just update the Gradle to 3.0.1 .and the problem is solved.
My problem was different from all answers; gradle distribution url was wrong..
It might be the problem that distributionUrl can be wrong in gradle-wrapper.properties file.

Categories

Resources