locked
Xamarin.Forms Android App Basic Sample Using MVVMCross throws System.NullReferenceException RRS feed

  • Question

  • User268274 posted

    I am trying to create a basic sample using MVVMCross. I have replicated it from another sample. The sample works fine but the code that I created throws an exception.

    I have checked if there is any discrepency between the 2 codes, but there is not difference.

    I am using

    MVVMCross Version (6.4.2) MVVMCross.Forms Version(6.4.2) Xamarin.Essentials (1.3.1) Xamarin.Forms (4.6.0.847) The error that I encounter System.NullReferenceException: 'Object reference not set to an instance of an object.'

    Partial output

    06-12 12:44:07.819 D/Mono (22406): Found as 'javainteropjnienvcallnonvirtualfloatmethod_a'. 06-12 12:44:17.541 D/ (22406): HostConnection::get() New Host Connection established 0x87133640, tid 22406 System.NullReferenceException: 'Object reference not set to an instance of an object.'

    There seems no other way to identify where and what is going wrong. I have attached the code sample.

    Sunday, June 14, 2020 8:40 AM

All replies

  • User382871 posted

    When using the library, we need to change some settings manaually. For example, the Activity class should inherit from 'MvxFormsAppcompatActivity' instead of FormsAppCompatActivity on android.

    You could google with the keyword as Using MvvmCross with Xamarin.Forms to check the related tutorial.

    Monday, June 15, 2020 9:12 AM