Phonegap-plugin-barcodescanner - doesn't work after creating .apk

Hi,
I’m using phonegap-plugin-barcodescanner in my ionic v1 app. All is fine when I run my app on my phone using: ionic cordova run android -lc.

But after creating an apk file using:
ionic package build android

when I want to read a qr-code, I get this error : “TypeError: Cannot read property ‘scan’ of undefined”. (from this line of code: $cordovaBarcodeScanner.scan().then(function (imageData) {…)

any help appreciated