{"id":7726,"date":"2015-10-19T01:11:45","date_gmt":"2015-10-19T01:11:45","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/10\/19\/okhttp-binding-library-for-xamarin-android-throwing-error-open-source-projects-square-okhttp\/"},"modified":"2015-10-19T01:11:45","modified_gmt":"2015-10-19T01:11:45","slug":"okhttp-binding-library-for-xamarin-android-throwing-error-open-source-projects-square-okhttp","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/10\/19\/okhttp-binding-library-for-xamarin-android-throwing-error-open-source-projects-square-okhttp\/","title":{"rendered":"OkHttp binding library for Xamarin Android throwing error-open source projects square\/okhttp"},"content":{"rendered":"<p>I&#8217;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.<\/p>\n<p>Line:<\/p>\n<p><code>var handler = new OkHttpNetworkHandler();<\/code><\/p>\n<p>Throws:<\/p>\n<pre><code>[] Missing method Android.Runtime.JNIEnv::AllocObject(Type) in assembly Mono.Android.dll, referenced in assembly \/data\/data\/com.my.app\/files\/.__override__\/OkHttp.dll\n[MonoDroid] UNHANDLED EXCEPTION: System.MissingMethodException: Method not found: 'Android.Runtime.JNIEnv.AllocObject'.\n[MonoDroid] at ModernHttpClient.OkHttpNetworkHandler..ctor () \n<\/code><\/pre>\n<p>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&#8217;m using Xamarin Studio 4.0.13 and Mono 3.2.3.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;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: &#8216;Android.Runtime.JNIEnv.AllocObject&#8217;. [MonoDroid] at ModernHttpClient.OkHttpNetworkHandler..ctor () [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7726","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7726"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7726\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}