14 Replies Latest reply on Mar 30, 2017 10:12 PM by umit Bostanci

    System.NotSupportedException: Unable to activate instance of type... Xamarin EMDK SampleProject

    Jeremy Henkes,2oh928vwkwbk952gi2osgjlwg0p7eukk

      Hi everyone,


      I am currently trying to get the BasicScanningTutorial running on a TC55 device with Xamarin in Visual Studio. I downloaded the sample from HERE. I can debug the application and everything works as expected, but whenever I minimize the app (pressing Android 'Back' or 'Home' button), following error comes up:


      01-10 00:22:51.074 I/MonoDroid(13455): UNHANDLED EXCEPTION:

      01-10 00:22:51.084 D/dd:     (13455): scanner.release: isBTScanner: false

      01-10 00:22:51.094 I/MonoDroid(13455): System.NotSupportedException: Unable to activate instance of type Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor from native handle 1d200001 ---> System.MissingMethodException: No constructor found for Symbol.XamarinEMDK.Barcode.Scanner+IStatusListenerImplementor::.ctor(System.IntPtr, Android.Runtime.JniHandleOwnership) ---> Java.Interop.JavaLocationException: Exception of type 'Java.Interop.JavaLocationException' was thrown.

      01-10 00:22:51.094 I/MonoDroid(13455): Java.Lang.Error: Exception of type 'Java.Lang.Error' was thrown.

      01-10 00:22:51.094 I/MonoDroid(13455):   --- End of managed exception stack trace ---


      It doesn't always happen after the first time, but it is guaranteed to happen after reopening and minimizing it a couple of times. It also sometimes happens that there is no error, but then the scanner won't read barcodes anymore. The scanner is enabled and the laser is showing on hard-button press, but nothing happens when trying to scan a barcode.

      I don't really know how to resolve this issue. I followed the instructions on how to set everything up (VS, Xamarin, EMDK), thus everything should be set up correctly. I didn't change any of the sample code from BasicScanningTutorial.


      So why exactly do I get the exception mentioned above and what can I do to resolve this issue?


      I appreciate any help!