Redth / ZXing.Net.Mobile

Barcode Scanner for Xamarin.iOS, Xamarin.Android, UWP and Tizen
MIT License
1.07k stars 701 forks source link

The type or namespace name 'Platform' does not exist in the namespace 'ZXing.Net.Mobile.Forms.WindowsUniversal' #1020

Open 6pac opened 2 years ago

6pac commented 2 years ago

As advised in the Wiki, I am adding the ZXing.Net.Mobile.Forms and ZXing.Net.Mobile nuget packages to the relevant projects.

However in my UWP project, when I try to do in the main form constructor

ZXing.Net.Mobile.Forms.WindowsUniversal.Platform.Init(); 

I get: The type or namespace name 'Platform' does not exist in the namespace 'ZXing.Net.Mobile.Forms.WindowsUniversal'. I can't find a single thing, Googling it, which is weird.

Am I making an obvious mistake, or do we no longer need to initialise the platform?

rpetersonfujitsu commented 2 years ago

This is a duplicate of #894 (and #905).

Here's the fix/workaround: "This is not included in the versions on Nuget - but all that it does is combine both of these calls together;" ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingScannerViewRenderer.Init(); ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingBarcodeImageViewRenderer.Init();

6pac commented 2 years ago

Thanks, but this should really be changed or added in the readme.md. Is there anyone who has commit to the repo? Looks like the most recent changes were 12 months ago, is the repo still active?

rpetersonfujitsu commented 2 years ago

Good question on whether the repo is still active or not; I wouldn't know. For the NuGet package, the latest non-beta version was 2.4.1 on 2018-04-04, and that's the one that I tried first, but it has some issues it seems. (I can't go back to the previous page on UWP). There have been quite a few beta releases since then. The latest beta release is 3.1.0-beta2, which, as you said, was released 1 year ago (2021-01-19). Maybe it is sufficient? I still need to try it myself.

6pac commented 2 years ago

Hmmm. I'd basically given up on ZXing, and was evaluating several paid libraries (1-2k $US). ZXing does appear to be semi abandoned. It looks like it did basically work, but there may be bugs for some devices and future devices are unlikely to be supported. Not terribly compelling. Might be worth using as a stopgap.