A workaround for Android "L" Okio packaging problem. Place all of the following in a libs/
folder.
Due to a bug in the packaging of Android OS "L", dependencies which reference Okio need to be repackaged.
For more information see https://github.com/square/okhttp/issues/967
Download jarjar-1.4.jar
and place it in this directory.
Download OkHttp, Okio, and optionally OkHttp UrlConnection and place it in this directory.
The contents of the folder should look like:
-rw-r--r-- 1 you you 118K Jul 30 12:07 jarjar-1.4.jar
-rw-r--r-- 1 you you 34B Jul 30 12:08 jarjar.rules
-rwxr-xr-x 1 you you 175B Jul 30 13:37 jarjar.sh
-rw-r--r-- 1 you you 255K Jul 30 12:09 okhttp-2.0.0.jar
-rw-r--r-- 1 you you 30K Jul 30 12:09 okhttp-urlconnection-2.0.0.jar
-rw-r--r-- 1 you you 51K Jul 30 12:09 okio-1.0.0.jar
Now run the jarjar.sh
script and you should see the repackaged jars:
-rw-r--r-- 1 you you 256K Jul 30 13:37 repackaged-okhttp-2.0.0.jar
-rw-r--r-- 1 you you 30K Jul 30 13:37 repackaged-okhttp-urlconnection-2.0.0.jar
-rw-r--r-- 1 you you 52K Jul 30 13:37 repackaged-okio-1.0.0.jar
Include these in your build.gradle
with:
dependencies {
compile fileTree(dir: 'libs', include: 'repackaged-*.jar')
}
rule okio.** com.squareup.okio.@1
#!/bin/bash
set -ex
rm repackaged-*.jar 2> /dev/null
for jar in `ls *.jar | grep -v 'jarjar-'`; do
java -jar jarjar-* process jarjar.rules "$jar" "repackaged-${jar}"
done