Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android Phonegap条形码扫描仪纵向模式_Android_Cordova_Cordova Plugins_Barcode Scanner - Fatal编程技术网

Android Phonegap条形码扫描仪纵向模式

Android Phonegap条形码扫描仪纵向模式,android,cordova,cordova-plugins,barcode-scanner,Android,Cordova,Cordova Plugins,Barcode Scanner,我正在用phonegap插件对二维码阅读器进行测试 我将代码安装到index.js中 cordova.plugins.barcodeScanner.scan( function (result) { alert("We got a barcode not \n" + "Result: " + result.text + "\n" + "Format: " + result.format + "\n" + "

我正在用phonegap插件对二维码阅读器进行测试

我将代码安装到index.js中

cordova.plugins.barcodeScanner.scan(
  function (result) {
      alert("We got a barcode not \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
      "prompt" : "Place a barcode inside the scan area", // supported on Android only
      "formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
      "orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device
  }
);
除了这一部分,一切似乎都正常,似乎根本没有触发。 我需要扫描仪是纵向的,但它总是在横向模式

{
      "preferFrontCamera" : true, // iOS and Android
      "showFlipCameraButton" : true, // iOS and Android
      "prompt" : "Place a barcode inside the scan area", // supported on Android only
      "formats" : "QR_CODE,PDF_417", // default: all but PDF_417 and RSS_EXPANDED
      "orientation" : "portrait" // Android only (portrait|landscape), default unset so it rotates with the device
  }
我在AdobePhoneGap上构建应用程序,并安装在Android 6.0.1上 我有什么遗漏或做错的吗?

我的错 我没有更新config.xml。 显然,phonegap构建使用的是旧版本的插件

需要这条线吗

<plugin spec="https://github.com/phonegap/phonegap-plugin-barcodescanner#6.0.1" />
<preference name="android-build-tool" value="gradle" />