简体   繁体   English

IONIC-找不到类型或名称空间名称“ Windows”-phonegap-plugin-barcodescanner

[英]IONIC - The type or namespace name 'Windows' could not be found - phonegap-plugin-barcodescanner

While building IONIC app for Windows which uses phonegap-plugin-barcodescanner, shows error 在为使用phonegap-plugin-barcodescanner的Windows构建IONIC应用程序时,显示错误

The type or namespace name 'Windows' could not be found 找不到类型或名称空间名称“ Windows”

Here it is, 这里是,

F:\A_LHS_Projects\DynamicApp\DA_Code\AA\DynamicApp_V3>ionic build windows

(node:6520) fs: re-evaluating native module sources is not supported. (节点:6520)fs:不支持重新评估本机模块源。 If you are using the graceful-fs module, please update it to a more recent version. 如果您使用的是graceful-fs模块,请将其更新为最新版本。 Running command: "C:\\Program Files\\nodejs\\node.exe" F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\hooks\\after_prepare\\010_add_platform_class.js F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3 运行命令:“ C:\\ Program Files \\ nodejs \\ node.exe” F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ hooks \\ after_prepare \\ 010_add_platform_class.js F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3

add to body class: platform-windows 添加到正文类:platform-windows

Building project: F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\platforms\\windows\\CordovaApp.Windows.jsproj 构建项目:F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ platforms \\ windows \\ CordovaApp.Windows.jsproj

    Configuration : debug
    Platform      : anycpu

Patching 8.1 in prebuild event... 在预构建事件中修补8.1 ...

Injected base.js reference to the www/index.html 注入了对www / index.html的base.js参考

Removing /( )(\\s </script>)(\\s*)/ from www/index.html Removing /( )(\\s </script>)(\\s*)/ from www/index.html 拆卸/()(\\ S </ SCRIPT>)(\\ S *)/从WWW / index.html的拆卸/()(\\ S </ SCRIPT>)(\\ S *)/从WWW / index.html中

Reader.cs(17,11): error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(17,11):错误CS0246:找不到类型或名称空间名称“ Windows”(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj]

Reader.cs(18,11): error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(19,11): error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(20,11): error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(21,11): error CS0246: The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly r Reader.cs(18,11):错误CS0246:找不到类型或名称空间名称“ Windows”(是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(19,11):错误CS0246:找不到类型或名称空间名称'Windows'(您是否缺少using指令还是程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(20,11):错误CS0246:找不到类型或名称空间名称“ Windows”(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(21,11):错误CS0246:找不到类型或名称空间名称“ Windows”(您是否缺少using指令或程序集r eference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(72,26): error CS0246: The type or namespace name 'MediaCapture' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(91,16): error CS0246: The type or namespace name 'IAsyncOperation<>' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(91,32): error CS0246: The type or namespace name 'Result' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinR ?[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(72,26):错误CS0246:类型或找不到名称空间名称“ MediaCapture”(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(91,16):错误CS0246:找不到类型或名称空间名称'IAsyncOperation <>'(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(91,32):错误CS0246:找不到类型或名称空间名称'Result'(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinR TBarcodeReader.csproj] Reader.cs(112,28): error CS0246: The type or namespace name 'Result' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(136,28): error CS0246: The type or namespace name 'Result' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(35,17): error CS0246: The type or namespace name 'BarcodeReader' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(45,17): error CS0246: The type or namespace name 'MediaCapture' could not be found (are you missing [TBarcodeReader.csproj] Reader.cs(112,28):错误CS0246:找不到类型或名称空间名称“结果”(是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(136,28):错误CS0246:找不到类型或名称空间名称“结果”(您是缺少using指令或程序集引用吗?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(35,17) :错误CS0246:找不到类型或名称空间名称“ BarcodeReader”(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(45,17):错误CS0246:找不到类型或名称空间名称'MediaCapture'(您是否丢失了? a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(50,17): error CS0246: The type or namespace name 'ImageEncodingProperties' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] Reader.cs(60,17): error CS0246: The type or namespace name 'InMemoryRandomAccessStream' could not be found (are you missing a using directive or an assembly reference?) [F:\\A_LHS_Projects\\DynamicApp\\DA_Code\\AA\\DynamicApp_V3\\plugins\\phonegap-plugin-barcodescanner\\src\\windows\\lib\\WinRTBarcodeReader.csproj] 使用指令还是程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(50,17):错误CS0246:找不到类型或名称空间名称“ ImageEncodingProperties”(您是否缺少using指令或程序集引用?)[F:\\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj] Reader.cs(60,17):错误CS0246:找不到类型或名称空间名称'InMemoryRandomAccessStream'(您是否缺少using指令或程序集引用?)[F: \\ A_LHS_Projects \\ DynamicApp \\ DA_Code \\ AA \\ DynamicApp_V3 \\ plugins \\ phonegap-plugin-barcodescanner \\ src \\ windows \\ lib \\ WinRTBarcodeReader.csproj]

Error: C:\\Program Files (x86)\\MSBuild\\14.0\\bin\\msbuild.exe: Command failed with exit code 1 错误:C:\\ Program Files(x86)\\ MSBuild \\ 14.0 \\ bin \\ msbuild.exe:命令失败,退出代码为1

I created sample barcode scanner app and its working fine. 我创建了示例条形码扫描仪应用程序,并且可以正常工作。 I used the same plugin which you used it. 我使用了与您使用的相同的插件。

<script type="text/javascript">
 function scan(){
    console.log("clicked");
    cordova.plugins.barcodeScanner.scan(function(result){
    //success callback
    alert(JSON.stringify(result));
    document.getElementById("data").innerHTML = result.text;

 },function(error){
    //error callback
    alert(JSON.stringify(error));

  });
 }
 </script>

and the HTML code is HTML代码是

<body>
 <h3>BAR CODE SCANNER</h3>
 <button onclick="scan()">SCAN</button>
 <br /><br />
 Value is  :: <div id="data"></div>
</body>

I test this and its working fine. 我对此进行了测试,并且工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Phonegap 3.0.0:BarcodeScanner插件 - Phonegap 3.0.0: BarcodeScanner Plugin Phonegap插件条码扫描器在iO上崩溃 - Phonegap plugin barcodescanner crashes on iOs phonegap项目中的条形码扫描仪插件问题 - barcodescanner plugin issue in phonegap project “找不到类型或命名空间&#39;AjaxControlToolkit&#39;...”的解决方案是什么? - What is the solution for “The Type or namespace 'AjaxControlToolkit' could not be found…”? 编译转换:运行TypeLite.tt时找不到类型或命名空间名称 - Compiling transformation: The type or namespace name could not be found when running TypeLite.tt PhoneGap条码扫描器插件未导出,原因是“转换为dalvik格式失败,错误为1” - PhoneGap barcodeScanner plugin not exporting due to “conversion to dalvik format failed with error 1” phonegap angularjs 条码扫描器 - phonegap angularjs barcodescanner 无法安装插件添加phonegap-plugin-push ionic 3 - can't installl plugin add phonegap-plugin-push ionic 3 如何将条码扫描器结果保存到Cordova插件中的localStorage条码扫描器 - How to save barcodeScanner result to localStorage in cordova plugin barcodeScanner 安装Phonegap / Cordova 3.1插件(条形码扫描器) - Installing Phonegap/Cordova 3.1 plugins (barcodescanner)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM