If neither work for some reason (pic2shop worked great for me on android 7, but they have to have the pic2shop free apk installed on the device), you can try using the mobile vision api from Google Play services. To get it to work, you will have to follow the Magic sample of replacing a magic control with a native control, and replace the magic control with the view for the barcode scanner.
It is significantly more complicated to implement, but you do not need to rely on an external apk... and is probably more future proof.