Ken Kosmowski Ken Kosmowski - 5 months ago 315
Android Question

Could not activate JNI Handle of java type MvxRecyclerView

I'd like to implement MvxRecyclerView, but I get following exception during runtime in SetContentView():

System.NotSupportedException: Could not activate JNI Handle 0x32700041
(key_handle 0xb29d17e8) of Java type
'mvvmcross/droid/support/v7/recyclerview/MvxRecyclerView' as managed
type 'MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView'.


I use the latest NuGet packages of Xamarin.Android.Support.. (23.3.0) and MvvmCross (4.1.6 / 4.1.7).

Any idea what causes this exception?

Answer

More information now on the issue from Ken Kosmowski: https://github.com/MvvmCross/MvvmCross-AndroidSupport/issues/252

Use the workaround by @kjeremy referenced there, till the issue got fixed: "The workaround consists of adding Resources\values\attrs.xml file to your Droid project with the following content:"

<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <declare-styleable name="MvxRecyclerView">
    <attr name="MvxItemTemplateSelector" format="string" />
  </declare-styleable>  
</resources>

For completion purpose.

With MVVMCross 4.2.0

You should remove the attrs.xml and change all of your MvxItemTemplateSelector references to MvxTemplateSelector.

Comments