Reputation: 161
Using volley for basic network operations,getting no connection handshake error when adding the project as an module.
While the module works fine in some another project.
On R&D, added retrypolicy but no use still getting the same error.
Here is my code. https://gist.github.com/fizzysoftware/a895bc2cbd1ad9a048277859f3f23963
Upvotes: 3
Views: 5738
Reputation: 208
In my project also same issues are faced. In Marshmallow its work suffecfully. But in Kitkat version it raised the issue
"com.android.volley.NoConnectionError: javax.net.ssl.SSLHandshakeException: Handshake failed"
For Handling this I used google's auth dependencies. Kindly add the following dependency in your Gradle
compile 'com.google.android.gms:play-services-auth:11.0.2'
And Implement the method for Installing Security Provider in Lower versions, If instalation's required
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.");
}
}
Then call the method in your activity, before making network operations.
Upvotes: 0
Reputation: 904
It could be one of these two cases:
These are at least the cases I've encountered so far...
Upvotes: 4