我有一個離子項目,我安裝了這個插件掃描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/ –