使用volley进行基本的网络操作,将项目作为模块添加时没有连接握手错误。
而该模块在另一个项目中运行良好。
在研发上,添加了重试策略,但没有用仍然得到相同的错误。
这是我的代码。https://gist.github.com/fizzysoftware/a895bc2cbd1ad9a048277859f3f23963
发布于 2017-02-02 20:44:09
这可能是以下两种情况之一:
这些至少是我到目前为止遇到过的案例。
发布于 2018-12-11 17:40:05
将url从Https更改为Http将起作用。
发布于 2017-08-22 16:33:19
在我的项目中也面临着同样的问题。在棉花糖中,它的工作已经足够了。但在Kitkat版本中,它提出了这个问题
"com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException:握手失败“
为了处理这个问题,我使用了google的auth依赖项。请在Gradle中添加以下依赖项
compile 'com.google.android.gms:play-services-auth:11.0.2'如果需要安装,请执行较低版本的Security Provider安装方法
private void updateAndroidSecurityProvider(Activity callingActivity) {
try {
ProviderInstaller.installIfNeeded(this);
} catch (GooglePlayServicesRepairableException e) {
// Thrown when Google Play Services is not installed, up-to-date, or enabled
// Show dialog to allow users to install, update, or otherwise enable Google Play services.
GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), callingActivity, 0);
} catch (GooglePlayServicesNotAvailableException e) {
Log.e("SecurityException", "Google Play Services not available.");
}}
然后在进行网络操作之前,在您的活动中调用该方法。
https://stackoverflow.com/questions/42002256
复制相似问题