Quantcast
Viewing all articles
Browse latest Browse all 204402

ZXing.Net into standard .net 2.0 library and Xamarin application

Hi,
I'm new to Xamarin and this whole .NET, I,m starting a new project and I was creating .NET library 2.0 to put the commun code. I have a need to extract multiple barcode from an image and was using ZXing as demo on Window with full .NET Framework 4.7. Now I would like to port this to Xamarin and I'm having some trouble to integrate it into my library. Here's my project structure:

  • GF-Trace.Android (Xamarin Android)

    • Reference to:
      • GF-Trace
      • NuGet packages:
      • Xamarin.Forms
      • ZXing.Net
        * Android.*
  • GF-Trace (.Net Standard 2.0 lib)

    • Build Dependencies:

      • GF-Imaging
    • NuGet packages:

      • Xamarin.Forms
      • ZXing.Net
  • GF-Imaging (.Net Standard 2.0 lib)

    • NuGet packages:
      • Xamarin.Forms
      • ZXing.Net

I have some hard time to make it work properly. The compiler complain about missing reference.

Severity    Code    Description Project File    Line    Suppression State
Error       Can not resolve reference: `zxing`, referenced by `GF-Trace`. Please add a NuGet package or assembly reference for `zxing`, or remove the reference to `GF-Trace`.  GF-Trace.Android        

Under UWP, it does compile but when running I get a method missing exception error:

System.MissingMethodException
  Message=Method not found: 'ZXing.Result[] ZXing.BarcodeReader.DecodeMultiple(Byte[])'.
  Source=GF-Trace
  StackTrace:
   at GF_Trace.Views.XyMeasurementPage.ExtractQRCodeMessageFromImage(Byte[] bitmap) in ...\GF-Trace\GF-Trace\Views\Debug\XyMeasurementPage.xaml.cs:line 128
...

So I wonder how I should be doing this? GF-Imaging is a reusable lib that implement function to manipulate images and could do some processing to recover barcode with ZXing. GF-Trace is the common application library that also can use some ZXing types. GF-Trace.Android or GF-Trace.UWP consume the GF-Trace.

The ZXing.Net said it support .Net Standard 2.0 and Xamarin.Android. What is wrong or how does one ensure the function and lib are present for a given platform?

NOTE I did select ZXing.Net and not the mobile version because the image can come from different source and not only from the camera as stand still image. So I tried to avoid the ZXing.Net.Mobile which wrap all into a Form GUI.

Thanks, Maybe I'm doing something wrong into my setup, but I have no clue why it doesn't found the lib or the methods.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>