Try this example
without renaming the component. Use two Buttons and try each.

If you have an external scanner app on your device, the code in Button3 should work. If you do not, you can use the component using the code in Button1.
You might also clean your camera lens; try scanning a different bar code etc.
You said "same code works in the older version, but in the current version it does not." .. What older version? What current version? When it does not work, what happens? Do you get a wrong result or what?
Are you using this with the same device as you used on your 'older' version? Since the scanner makes use of the device's camera, does the new device have a fixed focus lens; devices with a fixed lens sometimes cannot do
a scan unless the barcode is well illuminated.
If neither Button works, tell us about your Android device. What operating system does it use? What kind of barcode are you attempting to read? An image capture of the bar code posted to the Forum might help.