xamarin - Mvvmcross Android - Error Inflating Class: ClassNotFoundException -
i getting error in onviewmodelset() function when trying inflate xml file.
when calling
layoutinflater inflater = layoutinflater.from(this); view mainview = inflater.inflate(resource.layout.main, null);
i getting "java.lang.classnotfoundexception: mvx.mvxbindablelistview"
here whole exception:
android.views.inflateexception: binary xml file line #1: error inflating class mvx.mvxbindablelistview @ android.runtime.jnienv.callobjectmethod (intptr,intptr,android.runtime.jvalue[]) [0x00024] in /users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/mono.android/src/runtime/jnienv.g.cs:145 @ android.views.layoutinflater.inflate (int,android.views.viewgroup) [0x0003e] in /users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/mono.android/platforms/android-12/src/generated/android.views.layoutinflater.cs:543 @ androidcornerstonemobile.mainview.onviewmodelset () [0x00010] in c:\users\david\documents\work\androidxamarin\androidcornerstonemobile\views\mainview.cs:30 @ at cirrious.mvvmcross.droid.views.mvxactivityview`1<core.viewmodels.mainviewmodel>.set_viewmodel (core.viewmodels.mainviewmodel) <0x000bb> @ at cirrious.mvvmcross.extensionmethods.mvxviewextensionmethods.onviewcreate<core.viewmodels.mainviewmodel> (cirrious.mvvmcross.interfaces.views.imvxview`1<core.viewmodels.mainviewmodel>,system.func`1<core.viewmodels.mainviewmodel>) <0x00203> @ at cirrious.mvvmcross.droid.extensionmethods.mvxandroidactivityextensionmethods.onviewcreate<core.viewmodels.mainviewmodel> (cirrious.mvvmcross.droid.interfaces.imvxandroidview`1<core.viewmodels.mainviewmodel>) <0x00297> @ at cirrious.mvvmcross.droid.views.mvxactivityview`1<core.viewmodels.mainviewmodel>.oncreate (android.os.bundle) <0x000d3> @ at cirrious.mvvmcross.binding.droid.views.mvxbindingactivityview`1<core.viewmodels.mainviewmodel>.oncreate (android.os.bundle) <0x000b7> @ android.app.activity.n_oncreate_landroid_os_bundle_ (intptr,intptr,intptr) [0x00010] in /users/builder/data/lanes/monodroid-lion-bigsplash/0e0e51f9/source/monodroid/src/mono.android/platforms/android-12/src/generated/android.app.activity.cs:1837 @ at (wrapper dynamic-method) object.8c1f4311-41e4-4a0f-98f2-454a6152589a (intptr,intptr,intptr) <il 0x00017, 0x00043> @ @ --- end of managed exception stack trace --- @ android.view.inflateexception: binary xml file line #1: error inflating class mvx.mvxbindablelistview @ @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:691) @ @ android.view.layoutinflater.rinflate(layoutinflater.java:739) @ @ android.view.layoutinflater.inflate(layoutinflater.java:489) @ @ android.view.layoutinflater.inflate(layoutinflater.java:396) @ @ android.view.layoutinflater.inflate(layoutinflater.java:352) @ @ cirrious.mvvmcross.binding.droid.views.mvxbindingactivityview_1.n_oncreate(native method) @ @ cirrious.mvvmcross.binding.droid.views.mvxbindingactivityview_1.oncreate(mvxbindingactivityview_1.java:31) @ @ android.app.activity.performcreate(activity.java:4539) @ @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1049) @ @ android.app.activitythread.performlaunchactivity(activitythread.java:2013) @ @ android.app.activitythread.handlelaunchactivity(activitythread.java:2083) @ @ android.app.activitythread.access$600(activitythread.java:134) @ @ android.app.activitythread$h.handlemessage(activitythread.java:1233) @ @ android.os.handler.dispatchmessage(handler.java:99) @ @ android.os.looper.loop(looper.java:137) @ @ android.app.activitythread.main(activitythread.java:4697) @ @ java.lang.reflect.method.invokenative(native method) @ @ java.lang.reflect.method.invoke(method.java:511) @ @ com.android.internal.os.zygoteinit$methodandargscaller.run(zygoteinit.java:787) @ @ com.android.internal.os.zygoteinit.main(zygoteinit.java:554) @ @ dalvik.system.nativestart.main(native method) @ caused by: java.lang.classnotfoundexception: mvx.mvxbindablelistview @ @ dalvik.system.basedexclassloader.findclass(basedexclassloader.java:61) @ @ java.lang.classloader.loadclass(classloader.java:501) @ @ java.lang.classloader.loadclass(classloader.java:461) @ @ android.view.layoutinflater.createview(layoutinflater.java:552) @ @ android.view.layoutinflater.createviewfromtag(layoutinflater.java:680) @ ... 20 more
to inflate mvvmcross classes, must use bindinginflate
methods provided mvxactivity
classes. easiest way call setcontentview()
within oncreate()
or onviewmodelset()
.
these methods route inflation via mvvmcross binding code knows how interpret mvx.
abbreviated namespaces , knows how unpack mvxbind
binding statements.
the default android inflater doesn't know either of these things - can't use it.
Comments
Post a Comment