前提・実現したいこと
QRコードの読み取りをアプリで行うために Phonegap BarcodeScanner のプラグインを利用したい。
発生している問題・エラーメッセージ
cordova.plugins.barcodeScanner.scan の関数を呼び出したときに
[アプリ名]が停止しました。
というエラーメッセージ後アプリが強制終了します。
該当のソースコード
cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode\n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "Cancelled: " + result.cancelled); }, function (error) { alert("Scanning failed: " + error); }, { preferFrontCamera : true, // iOS and Android showFlipCameraButton : true, // iOS and Android showTorchButton : true, // iOS and Android torchOn: true, // Android, launch with the torch switched on (if available) saveHistory: true, // Android, save scan history (default false) prompt : "Place a barcode inside the scan area", // Android resultDisplayDuration: 500, // Android, display scanned text for X ms. 0 suppresses it entirely, default 1500 formats : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED orientation : "landscape", // Android only (portrait|landscape), default unset so it rotates with the device disableAnimations : true, // iOS disableSuccessBeep: false // iOS and Android }
ソースコード
### 試したこと Phonegap BarcodeScannerのプラグインを一度無効化してから有効化し、再度カスタムデバッガーとデバッカーを端末に入れて試したが状況は変わらずでした。 ### 補足情報(FW/ツールのバージョンなど) Cordova ver.9.0.0 Phonegap BarcodeScanner ver.8.1.0 よろしくお願いします。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。