Moon Light Box

Time is Money

Android - Volley Build Failed in Android SDK 23

| Comments

Apache HTTP Client Removal start from Android SDK 23. So we have to add they back manually.

The org.apache.http.legacy.jar is in Android/sdk/platforms/android-23/optional and copy it to your Android project. For exmple, libs folder.

1. Modified build.gradle file with below changes.

dependency {
    compile project('libs/org.apache.http.legacy.jar')
}

or

android {
    useLibrary 'org.apache.http.legacy'
}

2. Modified proguard files.

Warning:library class org.apache.http.conn.scheme.LayeredSocketFactory extends or implements program class org.apache.http.conn.scheme.SocketFactory
Warning:library class android.webkit.WebView depends on program class android.net.http.SslCertificate
Warning:library class android.webkit.WebViewClient depends on program class android.net.http.SslError
Warning:library class org.apache.http.params.HttpConnectionParams depends on program class org.apache.http.params.HttpParams
-keep class org.apache.http.** { *; }
-dontwarn org.apache.http.**
-dontwarn android.net.**

Reference:https://github.com/mcxiaoke/android-volley/issues/92
Reference:http://developer.android.com/preview/behavior-changes.html#behavior-apache-http-client

Comments

comments powered by Disqus