相机未打开以扫描 SAP UI5 中的条码

Camera is not opening to scan Barcode in SAP UI5

我正在设计 SAP UI5 应用程序来扫描条码。主屏幕包含一个按钮,点击它相机应该寻找条形码。但是我的Camera根本就没有opening.Below是我的控制器代码-

_Scanner : function(oEvent){
             alert("looking for camera");
             cordova.plugins.barcodeScanner.scan(

                      function (result) {

                          alert("We got a barcode" + result.text);

                      },

                      function (error) {

                          alert("Scanning failed: "+error);

                      }

                   );
             alert("will look for camera2");
                  }

index.html

<script type=”text/javascript” src=”cordova.js”></script>

<script type=”text/javascript” src=”js/index.js”></script>

我正在使用以下命令添加条形码插件- cordova plugin add cordova-plugin-barcodescanner (在cmd中添加成功)

我正在 Android v6 上测试此应用程序。让我知道解决方案

我使用了设备就绪功能。现在,它正在工作