Due to a bug in the packaging of Android OS "L", dependencies which reference Okio need to be repackaged.
For more information see square/okhttp#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')
}
jarjar.sh
was failing for me on MacOS without any existing repackaged jar files in the directory, had to replacerm repackaged-*.jar 2> /dev/null
withrm -f repackaged-*.jar