Cordova windows 10 构建验证失败(无 UTF8 文件)
Cordova windows 10 build fails validation (no UTF8 files)
当使用以下方式添加 windows cordova 平台时:
cordova 平台添加 windows
并且 visual studio 2015 内的 windows 10 项目用于构建应用程序包,当使用 "Windows App Certification Kit 10.0" 进行验证时,包验证失败。所选架构为:x86(发布版)、x64(发布版)和 ARM(发布版)。
UTF-8 file encoding
Error Found: The UTF-8 file encoding test detected the following errors:
File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\cordova_plugins>.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte >Order Mark).
File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\cordova-js->src\exec.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including >Byte Order Mark).
File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\cordova-js->src\platform.js is not properly UTF-8 encoded. Re-save the file as UTF-8 >(including Byte Order Mark).
...
File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\index.html is >not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order >Mark).
Impact if not fixed: HTML, CSS, and JavaScript files must be encoded in UTF-8 >form with a corresponding byte-order mark (BOM) in order to benefit from >bytecode caching and to avoid other runtime error conditions.
Bytecode generation
Error Found: The bytecode generation test detected the following errors:
File \?\C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\plugins\cordo>va-plugin-splashscreen\www\windows\SplashScreenProxy.js has JavaScript syntax >or other problems.
File \?\C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\plugins\cordo>va-plugin-splashscreen\www\splashscreen.js has JavaScript syntax or other >problems.
File \?\C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\js\app.min.js >has JavaScript syntax or other problems.
...
Impact if not fixed: As a performance optimization to accelerate JavaScript >execution time, JavaScript files ending in the ".js" extension generate >bytecode when the app is deployed. This optimization significantly improves >start-up and ongoing execution times for JavaScript.
How to fix: You may need consider one or more of these steps to fix the issue:
- Avoid deploying the app by pressing F5 in Visual Studio, create an appx >package instead
- Ensure that event logging is enabled
- All JavaScript files are syntactically valid; otherwise exclude the >respective files from the package
- Please note that you should uninstall all previous versions of the app >before deploying
Otherwise exclude the respective files from the package.
我尝试提交,但应用程序失败。
cordova 不应该生成准备发布的项目吗?
我是否应该创建一个 hook/nodejs 文件来重写 utf8 中的所有文件?
cordova build
对 windows
有效
cordova prepare 自 2016 年 1 月起更改了它的行为 - 添加 BOM 属性现在仅发生在构建步骤而不是准备步骤中。
背景:
- CB-10193 在构建阶段将 BOM 添加到 www 文件而不是准备阶段
http://mail-archives.apache.org/mod_mbox/cordova-commits/201601.mbox/%3C05738d19a02748cb8d40df330d6b8216@git.apache.org%3E
- http://markmail.org/thread/cg5s2jvxvyyqcqpd
--> 使用 'cordova build' 命令添加 BOM
当使用以下方式添加 windows cordova 平台时: cordova 平台添加 windows
并且 visual studio 2015 内的 windows 10 项目用于构建应用程序包,当使用 "Windows App Certification Kit 10.0" 进行验证时,包验证失败。所选架构为:x86(发布版)、x64(发布版)和 ARM(发布版)。
UTF-8 file encoding Error Found: The UTF-8 file encoding test detected the following errors:
File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\cordova_plugins>.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte >Order Mark). File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\cordova-js->src\exec.js is not properly UTF-8 encoded. Re-save the file as UTF-8 (including >Byte Order Mark). File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\cordova-js->src\platform.js is not properly UTF-8 encoded. Re-save the file as UTF-8 >(including Byte Order Mark). ... File C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\index.html is >not properly UTF-8 encoded. Re-save the file as UTF-8 (including Byte Order >Mark).
Impact if not fixed: HTML, CSS, and JavaScript files must be encoded in UTF-8 >form with a corresponding byte-order mark (BOM) in order to benefit from >bytecode caching and to avoid other runtime error conditions. Bytecode generation Error Found: The bytecode generation test detected the following errors:
File \?\C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\plugins\cordo>va-plugin-splashscreen\www\windows\SplashScreenProxy.js has JavaScript syntax >or other problems. File \?\C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\plugins\cordo>va-plugin-splashscreen\www\splashscreen.js has JavaScript syntax or other >problems. File \?\C:\Program >Files\WindowsApps\BECC1407.AppXPTO_1.4.0.0_x64__6hmvhj7j5fc1t\www\js\app.min.js >has JavaScript syntax or other problems. ... Impact if not fixed: As a performance optimization to accelerate JavaScript >execution time, JavaScript files ending in the ".js" extension generate >bytecode when the app is deployed. This optimization significantly improves >start-up and ongoing execution times for JavaScript. How to fix: You may need consider one or more of these steps to fix the issue: - Avoid deploying the app by pressing F5 in Visual Studio, create an appx >package instead - Ensure that event logging is enabled - All JavaScript files are syntactically valid; otherwise exclude the >respective files from the package - Please note that you should uninstall all previous versions of the app >before deploying Otherwise exclude the respective files from the package.
我尝试提交,但应用程序失败。
cordova 不应该生成准备发布的项目吗?
我是否应该创建一个 hook/nodejs 文件来重写 utf8 中的所有文件?
cordova build
对 windows
有效cordova prepare 自 2016 年 1 月起更改了它的行为 - 添加 BOM 属性现在仅发生在构建步骤而不是准备步骤中。
背景:
- CB-10193 在构建阶段将 BOM 添加到 www 文件而不是准备阶段 http://mail-archives.apache.org/mod_mbox/cordova-commits/201601.mbox/%3C05738d19a02748cb8d40df330d6b8216@git.apache.org%3E
- http://markmail.org/thread/cg5s2jvxvyyqcqpd
--> 使用 'cordova build' 命令添加 BOM