[SOLVED] Barcode Scanner Plugin not compatible with VS 2017?

Hi all,

i added the Barcode Scanner Plugin as described under

When i build the project / open it in Visual Studio i get the message
WinRTBarcodeReader (not compatible)

When i run the project on a device ( windows 10 phone ) the plugin is obviously missing.
Did anyone came across this issue and has a solution?
image

OK my fault ( as i am kind of new to ionic ). Here is what i have done to fix it, in case someone else will stumble over the same mistake i made.

I tried opening the project in VS2015. where there reference to WinRTBarcodeReader was not broken, but the scanner did not work there with the same error ( Plugin not found )
So i figured it must have been something else. In this case i did not wrap the code inside platform.ready()
This solved the problem:

this.platform.ready().then(() => {
  BarcodeScanner.scan().then((barcodeData) => {
    console.log(barcodeData);
  // Success! Barcode data is here
  }, (err) => {
      // An error occurred
  });
});

After that i opend the project in VS2017 again, ( still the reference was defined as incompatible ) but i was able to build an run the project on the device without any problems.

1 Like