Cordova windows 10 build fails validation (no UTF8 files) - node.js

When a windows cordova platform is added using:
cordova platform add windows
And the windows 10 project, inside visual studio 2015, is used to build the app package, the package validation fails, when it's validated using the "Windows App Certification Kit 10.0". The selected architectures are: x86 (release), x64(release) and ARM (release).
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.
I tried to submit but the apps fails.
Should not the cordova generate the project ready for publication?
Should I create a hook/nodejs file to rewrite all the files in utf8?

cordova build
does the trick on windows
cordova prepare changed it's behaviour since January 2016 - adding the BOM attribute now only takes place in the build step instead of the prepare step.
background:
CB-10193 Add BOM to www files at build stage instead of prepare
http://mail-archives.apache.org/mod_mbox/cordova-commits/201601.mbox/%3C05738d19a02748cb8d40df330d6b8216#git.apache.org%3E
http://markmail.org/thread/cg5s2jvxvyyqcqpd
--> the BOM gets added using the 'cordova build' command
see as well: https://issues.apache.org/jira/browse/CB-11241?focusedCommentId=15288933&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15288933

Related

Internal Compile Error in NSIS

I am creating a NSIS installer which installs multiple .exe's as well. Now these other .exe's makes the installer bigger than 2GB which is the set limit. I used WinImage PlugIn which is supposed to remove the limit. I replaced the files in my NSIS folder with these of the PlugIn's but i still receive the same error. Any help will be greatly appreciated.
If you are still hitting the compiler limitation then something in your install script is still including large file(s) directly into your .exe.
To use the WinImage plug-in you first must compile a installer that just builds the .wim file locally on your machine. Then you must remove the File/File /r commands from your installer and replace them with calls to the WinImage plug-in.

FBX Converter - Gear VR

This is a x-post from my question listed at https://answers.oculus.com/questions/583/fbx-converter-gear-vr.html
I'm attempting to use the Oculus FBX converter tool which came bundled with the Oculus Mobile SDK for Samsung Note 4 download.
Unfortunately, FBX Converter appears to be a Windows only tool :(, so I'm attempting to run this via Parallels Desktop.
There's a readme file in the tools dir which contains some instructions for downloading the AutoDesk FBX SDK and moving to an appropriate directory. I've followed them.
Inside the tools dir I see a makefile. Windows does make? Cool, so I attempt to make:
makefile(3) : fatal error U1033: syntax error : '=' unexpected Stop.
Huh... luckily there's a Visual Studio solution here. So I open the .sln and build. Dang, looks like I have to change the Platform Toolset to v110 because I have VS2012. Try again... Ahhh man, bunch of syntax errors about unexpected identifiers in std::max. I guess I'll try and fix it - std::max - expected an identifier
Cool, build is starting and..... ugh. cannot open file libfbxsdk.lib. Wait a second, I bet it's an issue with how the .sln is pulling in it's dependencies. Yup, wrong pathing. Add an extra ../ and here we go.... nope, no dice. cannot open include file fbxsdk.h.
So that's where I am right now. All I really want to do is convert an fbx file to a .ovrscene. Is that so much to ask? Is there a better way to do this? I hope so.
oh.... looks like there's a bin dir with the FBXConvert .exe included in the download. You'll have to add a .dll, to your System32 directory. That was awesome.

Fatal error cannot run 'mt.exe' at compiling VS 2012 C++ project

I upgraded Visual Studio to VS Professional 2012.
Building old Visual C++ projects resulted in the error:
LINK : fatal error LNK1158: cannot run 'mt.exe'
Putting the folder with mt.exe into the path did not help.
Currently I am using mt.exe in the folder C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\x64
Set "Generate manifest" as No in Linker. This helped
As mentioned at fatal error LNK1158: cannot run 'mt.exe', there are times where turning off manifest generation is not an option, because one is actually using manifests.
At which point, one comes back to fixing the actual problem.
One cause of the actual problem is a bad executable search path.
I personally once had a setting for $(ExecutablePath) in the project file (VC++ Directories → Executable directories in the project settings) that was yielding an executable search path one of whose pathnames wasn't a valid directory name.
The pathname had a colon in one of its directory name components (caused by prefixing ..\..\ to another variable, which happened to contain an absolute pathname with a drive letter, rather than a relative pathname as expected).
In a sensible world, errors in path searches caused by merely bad/missing directories cause the pathname to just get skipped over, and the search to proceed to the next pathname in the search path.
link, in contrast, fails with this error (as indeed does midl when it tries to find cl.exe).
This is very confusing when one looks at the search path (with the build output level set to "detailed") and sees that the SDK directory containing mt.exe is right there in it, plain as day.
It seems that link does not live in a sensible world. ☺
The fix was to correct the bad project setting, of course.

Installing Emacs Emulation keybindings -- Invalid VSIX package

I'm trying to install the extension for Visual Studio 2012 that allows emacs key-bindings.
I'm following through the steps here:
Emacs Keybindings in Visual Studio 2012 or 2013
I'm up to step 5:
Run the vsik file as administrator. This is required so the extension
can write Emacs.vsk into the program files folder. I wasn't sure the
best way to do this so I ran a command prompt as admin and then
executed start emacsemulations.vsik from the prompt.
So, running emacsemulations.vsix from an administrator command prompt,
I get the following error "This VSIX package is invalid because it does not contain the file extension.vsixmanifest at the root."
I'm not changing any of the file names inside the package.
I'm thinking this may have something to do with how windows zips up the file -- I'm able to recreate the problem simply by unzipping and rezipping the EmacsEmulation.vsix file without changing the contents of the vsix package.
If anyone has any suggestions on how to fix, or even better, the actual updated vsix file itself, I'd be very grateful!
The issue you have relies on the way you are zipping your file, what you should do is zip all files inside the folder you created (in this case, "EmacsEmulations") when you unzipped it.
Step into the EmacsEmulations folder.
Select all files.
Add to .zip
Rename the .zip output to EmacsEmulations.vsix
I'm trying to get this extension to work too, so good luck!

Allegro SCAN_DEPEND problems

I am trying to build a project with the allegro-msvc80-4.2.2 pre-built package. I'm using Visual C++ Express Edition 2005 and have added the input library alld.lib and am including allegro.h asp per these instructions:
http://wiki.allegro.cc/index.php?title=Visual_C%2B%2B_Express_2005
When I compile, I get the fatal error:
C1083: Cannot open include file:
'pc.h': No such file or directory
This is because the allegro platform header file "aldjgpp.h" tries to include the nonexistent file (as well as others such as dpmi.h and unistd.h) if SCAN_DEPEND is undefined.
If I try defining SCAN_DEPEND, I get an error from alconfig.h saying "platform not supported."
That error indicates that you are not using the proper header files. The header files that come with the pre-built files are set appropriately.
You should have an include/allegro/platform/alplatf.h file. For MSVC that should have one line:
#define ALLEGRO_MSVC
The best solution is to delete all instance of Allegro source from your computer, and redownload the file. Be sure to check your compiler's directories for stray headers. The following command, as run from the cmd.exe prompt, will help you find any files.
dir /s c:\allegro.h
If you continue to use the old header files, you may run across other problems.
Also, you may want to consider using Allegro 4.2.3, as it is the latest version of the 4.2 series. (Available at http://www.allegro.cc/files/.)

Resources