我有一个离子项目,我安装了这个插件扫描qrcodes:错误扫描条形码与离子/科尔多瓦
cordova plugin add https://github.com/wildabeast/BarcodeScanner.git
但是,当我一个三星S5采用Android 6.0的设备上运行的应用程序,我得到一个相机错误: “很抱歉,Android相机出现了问题,您可能需要重启设备。”
任何的是什么原因导致这个问题的想法?
我与测试:
ionic run android -l -c
ionic run android
这是当我按下一个按钮,执行我的代码:
$scope.scanBarcode = function() {
$ionicPlatform.ready(function() {
$cordovaBarcodeScanner.scan().then(function(imageData) {
console.log("Barcode text -> " + imageData.text);
console.log("Barcode Format -> " + imageData.format);
console.log("Cancelled -> " + imageData.cancelled); // prints: cancelled
}, function(error) {
console.log("An error happened -> " + error);
});
});
};
嗨..我有同样的问题,Experia还Z5 ......在其他设备它的工作...我的建议是尝试设置的最低SDK版本andoird ..不是试图在config.xml添加: –
Did解决你的问题?然而,我正在使用另一个插件“https://github.com/wildabeast/BarcodeScanner.git” –
详细的博客:http://sforsuresh.in/cordova-sorry-android-camera-encountered-problem/ –