"jcenter.bintray.com:443 failed to respond" error in Android Studio - java

I am trying to build a project in Android Studio, and Android's default build tool, Gradle, ALWAYS gives me an error when it attempts to build my project. The following is the result of using the "gradlew build" command:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MyFirstApp'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.3.
Required by:
:MyFirstApp:unspecified
> Could not resolve com.android.tools.build:gradle:2.1.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/
gradle/2.1.3/gradle-2.1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle
/2.1.3/gradle-2.1.3.pom'.
> jcenter.bintray.com:443 failed to respond
I have tried using an http proxy, vpn, turning off my firewall, deleting the cache in the .gradle foler, and even completely reinstalling Android Studio, but nothing seems to be working.
I am new to Android development, so any information is appreciated!
Here is the error when the proxy is implemented:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'MyFirstApp'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.3.
Required by:
:MyFirstApp:unspecified
> Could not resolve com.android.tools.build:gradle:2.1.3.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/
gradle/2.1.3/gradle-2.1.3.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle
/2.1.3/gradle-2.1.3.pom'.
> Remote host closed connection during handshake
I was able to add the HTTPS certificate to the keystore for jcenter.bintray.com, but now I am getting a JVM error whenever I start android studio:
Android Studio JVM Error
I have checked my environment variables, tried changing them, and the error persists. My java environment variables are set as follows:
User Variables:
PATH: %JAVA_HOME%\bin
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_101
System Variables:
CLASSPATH: C:\Program Files\Java\jre1.8.0_101
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_101\bin
EDIT:
After setting my Java home path in the gradle.properties file, I am now getting a different error when I attempt to build my project.
Downloading https://services.gradle.org/distributions/gradle-2.14.1-all.zip
Exception in thread "main" java.net.SocketException: Software caused connection abort: recv failed
EDIT:
I just wanted to let everyone know that I figured it out! Apparently my parents put some insanely powerful parental control software on my computer a few years ago and I forgot it was there. After uninstalling, Android Studio now works flawlessly. The software basically blocked all unknown traffic coming in and out of most of the ports. Anyway, thank you to everyone for the help. I can finally start developing!

Try setting both http and https as shown below
gradlew -Dhttp.proxyHost=127.0.0.1 -Dhttp.proxyPort=8080 -Dhttps.proxyHost=127.0.0.1 -Dhttps.proxyPort=8144
EDIT1 :
Gradle is trying to download jars from https repo "https://jcenter.bintray.com" but java does not have client certificates. Follow below steps to import client certificates
Step 1 : Download Client Certificate
a) Open https://jcenter.bintray.com URL in the browser (i.e firefox)
b) Click on the lock icon right to the URL bar
c) Server URL is shown , click to get right arrow and then on "more information"
d) Pop-up is opened to view the certificate of the Server.
e) click on the "View Certificate", In "details" table export to a file CERT_FILE_NAME.crt
Step 2 : Import the client certificate to JDK which Gradle is using
keytool -import -noprompt -trustcacerts -alias "clojars.org" -file C:\CERT_FILE_NAME.crt -keystore C:\java\jre\lib\security\cacerts -storepass "changeit"

If you behind a proxy, you must set proxy for Gradle separately because Gradle doesn't use AndroidStudio's proxy settings:
open gradle.properties and add the following lines, change ip addr to your proxy's ip.
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyPort=7070
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=7070

I just wanted to let everyone know that I figured it out! Apparently my parents put some insanely powerful parental control software on my computer a few years ago and I forgot it was there. After uninstalling, Android Studio now works flawlessly. The software basically blocked all unknown traffic coming in and out of most of the ports. Anyway, thank you to everyone for the help. I can finally start developing!

I met this problem because i was in China. i set a wrong proxy for my AndroidStudio.it works when i delete my proxy in config file gradle.properties located in gradle directory.
Hope this can help you!
systemProp.https.proxyPort=10808
systemProp.http.proxyHost=127.0.0.1
systemProp.https.proxyHost=127.0.0.1
systemProp.http.proxyPort=10808
Comment or delete above lines!

Other than adding the certificate of https://jcenter.bintray.com/ to your key store, can you also check if there is a parent certificate for https://jcenter.bintray.com/. If so, you may need to add that certificate as well in the keystore.

Related

Importing Project to Spring Boot Parent Pom Error

I was hoping someone could help me out. Some small details will be altered for anonymity.
Initial problem:*
When importing spring boot project into RAD I get this error:
Failure to transfer org.apache.maven:maven-archiver:pom:3.5.0 from https://nexusrm.<myCompany>.net:8443/repository/<myCompany>-maven/
was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact org.apache.maven:maven-archiver:pom:3.5.0 from/to central
(https://nexusrm.<myCompany>.net:8443/repository/<myCompany>-maven/): PKIX path building failed:
com.ibm.security.cert.IBMCertPathBuilderException: unable to find valid certification path to requested target
Inferred Cause:
I think my IDE cannot go to my companies nexus repository to get the parent pom file because the repo site uses a self signed certificate (or some other certificate error).
Workaround:
After opening my IDE (RAD/eclipse but I also have IntelliJ with same issue). I open the command line (windows 10), navigate/cd to my project, and add set MAVEN_OPTS="-Dmaven.wagon.http.ssl.insecure=true". This allows the Spring Boot project to run, but I have all sorts of other issues that may or may not be related and would like a permanant solution to this to make sure this is not causing issues. (other issues like when I open RAD I get popups saying failure to transfer other things, some projects saying incorrect package declarations, webserver+LDAP authentication stuff, etc)
Proposed Solution:
I believe I need to add the public certificate of the Nexus server to the trust store of the Java running Maven which I learned from this link https://support.sonatype.com/hc/en-us/articles/213465088-Maven-is-unable-to-connect-to-Nexus-after-configuring-Nexus-to-use-SSL- which says to do this:
Get the certificate from the server into a PEM encoded file on your Java client host:
keytool -printcert -rfc -sslserver example.com > example.pem (Optional/Advised)`
Import the certificate into the default Java truststore location under a relevant alias, using the default truststore password:
keytool -importcert -file example.pem -alias example.com -storepass changeit -keystore $JAVA_HOME/lib/security/cacerts
Main Questions
I cannot figure out how to do this. I need to know:
How to get the certificate (any browser) and how to put it into a PEM encoded file. In regards to the command-
I am unsure of what example.com should be and what example.pem should be. I know they are my server and pem file, but
Is server just the link of the nexus repo ie https://nexusrm.<myCompany>.net:8443/repository/<myCompany>-maven/? And
how do I generate this pem file?
Do I get the certificate by going to my browser->view certificate->details->copy to file?
What do I save the file as?
Conclusion:
Thanks so much for taking the time to read, I hope you can tell by my questions that I am new to all of this. It is possible there is a better way to fix this problem, or that this is not the right way to go about it at all it could be a firewall, configuration, or permissions thing, so any advice will be appreciated, just please keep in mind my skill level. I am just setting up my environment for my first software developer job, and trying to learn web applications using spring/spring boot. Please ask if you need more info.
Additional Info:
Java version 1.8_0_311 (jdk 1.8_0_311, jre 1.8_0_311)
Apache Maven Version 3.8.3
Particular error on Spring 2.5.5 but similair error on 2.6.0
I am using a Cisco anyconnect vpn

How to Resolve PKIX path building failed on Eclipse

I develop and distribute plugins.
I confirmed that there was a problem in plugin when installing the plugin in Eclipse.
problem detail : PKIX path building failed. sun.security.provider.certpath.SunCertPathBuilderException : unable to find valid certification path to requested targe
The detailed situation is as follows.
1 Years Ago, I applied ssl certificate to updatesite.
The certificate has expired and the certificate has been replaced.
The update site can be accessed from browsers (Chrome, Safari, etc.) and it has been confirmed that the certificate is valid.
But when I enter the url in Eclipse > Help > Install New Software I get a PKIX error.
So, when I checked, I found that the Fingerprint of Hostname displayed in Eclipse > Preferences > General > Network Connections > SSH2 > Known hosts was different.
So, even if I delete the corresponding value and apply it, the previous information is loaded again.
So it looked like the jvm was still loading.
To solve it, you can enter the following command when running it in Eclipse.
-Djavax.net.ssl.trustStore='certification path'
However, this is only a workaround for users, you cannot use this workaround as a distributor.
What settings should I make on the server?
For reference, it worked fine when applying the SSL certificate for the first time, but it didn't work after replacing it. Also, fortunately, thanks to backing up the previous certificate, the plug-in download from the update site works well after restoring it. (About 1 month left until the previous certificate)

Gradle sync failed: Cause: unable to find valid certification path to requested target on MacOS

I have the following configuration:
MacOS 11.0.1 (MacOS firewall is off)
Android Studio 4.1.2
Android Gradle plugin version 4.1.1
Gradle version 6.5
Java jdk version 1.8.0_251
Gradle build started to report an error in all my projects, so I guess it's not related to a specific project config (build.gradle etc.).
The same projects are building and working normally on the same Android Studio, Gradle and JDK versions on Windows.
Steps I already tried but didn't help:
Rebuild project
Invalidate caches / restart
Reinstall Android Studio from scratch, followed instructions for complete uninstall (How to completely uninstall Android Studio on Mac?)
A clean install of freshly downloaded Android Studio from https://developer.android.com/studio
Make a clean install using JetBrains Toolbox
Manually add certificates (downloaded from browser) to both Android Studio (Preferences/Tools/Server certificates) and Java keystore
Install Android Studio 4.2 beta 5
Install a newer version of JDK (1.8.0_281)
Error details:
Gradle sync failed: Cause: unable to find valid certification path to requested target
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'name-of-the-project'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:4.1.1.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:4.1.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.gms:google-services:4.3.4.
Required by:
project :
> Could not resolve com.google.gms:google-services:4.3.4.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.google.firebase:firebase-crashlytics-gradle:2.4.1.
Required by:
project :
> Could not resolve com.google.firebase:firebase-crashlytics-gradle:2.4.1.
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-crashlytics-gradle/2.4.1/firebase-crashlytics-gradle-2.4.1.pom'.
> Could not GET 'https://dl.google.com/dl/android/maven2/com/google/firebase/firebase-crashlytics-gradle/2.4.1/firebase-crashlytics-gradle-2.4.1.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
It seems like it is a network problem, but I tried to use different connection solutions with different providers, with and without VPN.
All mentioned files are accessible and I can download them from terminal using wget
wget https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom
--2021-03-04 12:42:32-- https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.3.4/google-services-4.3.4.pom
Resolving dl.google.com (dl.google.com)... 216.58.214.206
Connecting to dl.google.com (dl.google.com)|216.58.214.206|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1576 (1,5K) [application/octet-stream]
Saving to: ‘google-services-4.3.4.pom.1’
google-services-4.3.4.pom.1 100%[=====================================================================================>] 1,54K --.-KB/s in 0s
2021-03-04 12:42:32 (11,3 MB/s) - ‘google-services-4.3.4.pom.1’ saved [1576/1576]
I've been stuck with the exact same bug for several days, and like you I tried pretty much everything.
Finally I noticed something in Android Studio. I went to the Http Proxy preference tab and I saw a message saying
You have JVM property "https.proxyHost" set to "localhost"....
I tried to override this value by putting the line :
systemProp.https.proxyHost=
In my project gradle.properties file and tadaaa ! It works, I don't really understand what happened though...
Hoping to be helpful ;)
After additional research... for some reason, MacOS network proxy settings were changed and that was the reason for the warning Android Studio made:
You have JVM property "https.proxyHost" set to "localhost"....
To fix this, go to
System Preferences / Network / Advanced (for network you are using) / Proxy
and unselect Web Proxy and Secure Web Proxy
There another possible reason for not getting a valid certificate path. The various plugins you use in your gradle build are not necessarily using the trust store that contains the certificates to validate the authenticity of the certificate in question. In my case, I could communicate with a given server using a browser with no certificate validating errors, but I couldn't do the same using the "maven-publish" plugin. Why, because they are using different trust stores for certificate validation. The "maven-publish" uses the trust store that java has been configured to use. The default location is in directory $JAVA_HOME/jre/lib/security. The browser is using your OS trust store. The java trust store can be changed using the system properties:
javax.net.ssl.trustStore,
javax.net.ssl.trustStorePassword
javax.net.ssl.trustStoreType
You can set them in the gradle.properties file using this format:
systemProp.javax.net.ssl.trustStore={path to your truststore}
You can also set them in you build.gradle.kts script using this format:
System.setProperty("javax.net.ssl.trustStorePassword", "{your truststore password")

why am i not able to download eclipse?

i am trying to install eclipse for Java development.
But after hitting install i get "installation failed with an error. Show log"
This is the log file:
ERROR: org.eclipse.equinox.p2.artifact.repository code=13 Retry another mirror
ERROR: org.eclipse.oomph.p2.core code=0 Repeated attemps to download http://mirrors.xmission.com/eclipse/oomph/drops/milestone/S20191105-074631-1.15.0-M2/plugins/org.eclipse.nebula.widgets.tablecombo_1.2.0.201910251134.jar from the same site
java.io.IOException: Repeated attemps to download http://mirrors.xmission.com/eclipse/oomph/drops/milestone/S20191105-074631-1.15.0-M2/plugins/org.eclipse.nebula.widgets.tablecombo_1.2.0.201910251134.jar from the same site
at org.eclipse.oomph.p2.internal.core.CachingTransport.download(CachingTransport.java:122)
at org.eclipse.oomph.p2.internal.core.CachingTransport.download(CachingTransport.java:255)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:720)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact(SimpleArtifactRepository.java:644)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:776)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.getArtifact(MirrorRequest.java:319)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transferSingle(MirrorRequest.java:289)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.transfer(MirrorRequest.java:225)
at org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest.perform(MirrorRequest.java:155)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact(SimpleArtifactRepository.java:759)
at org.eclipse.equinox.internal.p2.artifact.repository.simple.DownloadJob.run(DownloadJob.java:64)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Maybe you have downloaded a corrupted artifact that now has been cached, and the installation won't run. Try by going under the .p2/org.eclipse.equinox.p2.core/cache path of your Eclipse installation path. You will probably find a zip, but without the extension. Try by deleting it, after doing a backup elsewhere.
Are you behind a corporate network? Maybe there is some kind of proxy blocking the host connection.

Weblogic server not running from jdeveloper

When i tried to run an application on jdeveloper, the server wont start and it shows the following message
*** Using HTTP port 7101 ***
*** Using SSL port 7102 ***
C:\Users\Ayodeji.Ayodeji\AppData\Roaming\JDeveloper\system11.1.2.3.39.62.76.1\DefaultDomain\bin\startWebLogic.cmd
[waiting for the server to complete its initialization...]
\IBM\WebSphere was unexpected at this time.
Process exited.
Finally i got the problem solved. I tried to locate the startWebLogic.cmd file in the specified path, and went through the file, then i realise its trying to access my classpath, so on checking my classpath from the environment variables, its has only entries to Websphere so i deleted the entry, restarted JDeveloper and my server is up and running.
I had the same issue with Eclipse setting Weblogic, I was trying to start the Server, but got the same error.
\IBM\WebSphere was unexpected at this time.
It was due to Window 7 folder security issue. As soon as I realized that, I close eclipse and start eclipse with Administration Right. That resolved the issue.
1.Go to
C:\Users\Ayodeji.Ayodeji\AppData\Roaming\JDeveloper\
Ayodeji.Ayodeji should be your PC User name
then change
system11.1.2.3.39.62.76.1
Folder name to another name and run.

Categories