When I build the project I receive the following error Error:SSL peer shut down incorrectly please let me know how to fix this error
-
3Possible duplicate of [Android SDK manager SSL peer shut down incorrectly](https://stackoverflow.com/questions/11571201/android-sdk-manager-ssl-peer-shut-down-incorrectly) – Mr. Roshan Jun 27 '18 at 12:30
16 Answers
It's probably a certificate problem, I had similar issue with Android Studio and I solved it by following these steps:
1 - Open gradle-wrapper-properties
file and modify https://
to http://
2 - Force using http
instead of https
in Android SDK Manager, just click on SDK Manager icon above on Android Studio Toolbar and go to SDK Update Sites
tab.
3 - Go to File -> Settings. In the IDE Settings section select Server Certificates, then check accept non-trusted certificates automatically
.
If the problem persist, then you should add the certificates to Android Studio, like *.google.com certificate.
In my case I tried to add multiple certificates but I still get SSL Error, After I opened https://services.gradle.org in my browser and I imported the certificate to Android Studio, Anyhow adding this as an SSL exception resolved the issue for me.
If the problem persist, I recommend to configure a proxy to just install the desirable dependencies. Open Gradle properties for proxy settings and add the following:
systemProp.http.proxyHost=x
systemProp.https.proxyPort=y
systemProp.https.proxyHost=x
systemProp.http.proxyPort=y

- 1,047
- 2
- 13
- 30
My problem was solved Clean Project
and then `Rebuild Project..
Hope this helps you,,

- 276
- 2
- 8
-
error appeared again ... SSL peer shut down incorrectly – saber tabatabaee yazdi Mar 29 '20 at 14:13
-
1try to change your SDK path or delete your build folder – Syed Muhammad Zeejah Hashmi ze Apr 15 '20 at 06:02
You have a slow Internet Connection & Your Android Studio Build got interrupted. Try to build in offline mode or fix your internet

- 1,061
- 3
- 12
- 26
Files -> Invalidate cashes / restart -> Invalidate and Restart.
This will solve the problem.

- 793
- 6
- 13
after testing other answers and nothing happened, I try a trick open another project that is synced successfully, find gradle version and gradle plugin version and use those in current project
just copy gradle version and gradle plugin version and use them in other project and sync

- 2,714
- 24
- 32
This may not be a generic answer, but I was able to solve it this way. If you're using the security software Kaspersky, try closing it and then running it.

- 223
- 2
- 6
-
thank you so much, everytime I had this problem, I have to reboot my mac (under sierra) now I just exit kaspersky and the job is done ;) – Nabil Ait Brahim Jul 08 '20 at 13:25
It is related to your Internet connection;
First Solution : Check your connection and turn off proxy, if you are using.
Second Solution : Change your proxy region to another and try again.

- 618
- 6
- 7
Go to Android SDK manager and update with latest SDK. After downloading just re syncy and error will be gone
Try to clean your project. If the problem does not solved use a proxy and sync your gradle and rebuild the project(if you are already using proxy server try to use an other one and be sure that your internet connection is stable).

- 9
- 1
Go to SDK Manager , then select SDK Update Sites and lastly Mark/Tick "Force https://....'
I don't know if it has to do, but I removed the VCS and resynced, it took a lot of time, then I clicked on the syncing process and I resumed something that was paused. Then it worked.

- 287
- 1
- 3
- 16
Hey Just update the classpath to latest version available I solved the error by this just write classpath 'com.android.tools.build:gradle:your.latest.version'
"SSL peer shut down incorrectly" - sometimes happens for slow internet connection, as well as when the server response is interrupted for connection problems.
So, in my case,
- I have a slow Internet Connection
- Android Studio Build got interrupted.
So I have joined with a strong network connection and the problem was gone. It was a network connection error for poor network in my case.

- 30,962
- 25
- 85
- 135

- 1,620
- 1
- 18
- 25