Barcode is not supported on the simulator. You have to run it on a real device. Even through you are just using the recognize from an image method, the APi itself is not included in the bundle for the simulator.
This error occurs when Barcode API is not recoginzed. Usually, Barcode,scanner functionality can only be tested in actual device. To be in safer side,you can run the code for device alone using System.get_property(platform)