OkHttp binding library for Xamarin Android throwing error-open source projects square/okhttp
I’m attempting to use the OkHttp-Xamarin library in a Xamarin Android application. Whenever I try to create a new OkHttpNetworkHandler I get the exception below.
Line:
var handler = new OkHttpNetworkHandler();
Throws:
[] Missing method Android.Runtime.JNIEnv::AllocObject(Type) in assembly Mono.Android.dll, referenced in assembly /data/data/com.my.app/files/.__override__/OkHttp.dll
[MonoDroid] UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: 'Android.Runtime.JNIEnv.AllocObject'.
[MonoDroid] at ModernHttpClient.OkHttpNetworkHandler..ctor ()
I am using prebuilt binaries from ModernHttpClient version 0.9. My minimum Android version is set to 2.3 and target is set to 4.2. I’m using Xamarin Studio 4.0.13 and Mono 3.2.3.