After hours and hours, I have finally got the barcode plugin working on phonegap build.
1) Must add to config.xml:
<preference name="android-build-tool" value="gradle" />
2) must edit the plugin text and remove spec="2.0.0"
change this: <plugin name="com.phonegap.plugins.barcodescanner" spec="2.0.0" source="npm" />
to this: <plugin name="com.phonegap.plugins.barcodescanner" source="npm" />
How can we fix the plugin to automatically do this for all future builds?