问题
I recently updated my Visual Studio to Visual Studio 2019 (from 2017), and this may be the cause of the problem I am about to describe.
Now, when I attempt to build by Ionic project for Windows, I get the error..
c:\program files (x86)\windows kits\10\include\10.0.15063.0\ucrt\corecrt.h(196): fatal error C1083: Cannot open include file: 'winapifamily.h': No such file or directory
[D:\dev\myapp\plugins\cordova-sqlite-storage\src\windows\SQLite3-WinRT-sync\SQLite3\SQLite3.UWP.vcxproj]
c:\program files (x86)\windows kits\10\include\10.0.15063.0\ucrt\corecrt.h(196): fatal error C1083: Cannot open include file: 'winapifamily.h': No such file or directory [D:\dev\myapp\plugins\cordova-sqlite-storage\src\windows\SQLite3-WinRT-sync\SQLite3\SQLite3.UWP.vcxproj]
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1
Looking in the above folder, I do not have winapifamily.h
in the above mentioned folder.
I did have another issue as described here, that I have tried to get around via the registry entry
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.0`where I set `MSBuildToolsPath` back to `C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64`
Not sure if this is related.
Also, I should mention, when I add the windows platform back (removed and added), I get the error
cordova.cmd platform add windows
Using cordova-fetch for cordova-windows@^7.0.0
Adding windows project...
Creating Cordova Windows Project:
....
cp: no such file or directory: D:\dev\myapp\node_modules\cordova-windows\node_modules\winjs\js\base.js
Infact I have no D:\dev\myapp\node_modules\cordova-windows\node_modules\winjs
folder at all, so not sure if this is related.
So, really everything seems broken for my Windows build now.
Anyway, does anyone have any idea for this SQLite problems specifically?
Thanks in advance for any help
来源:https://stackoverflow.com/questions/57487627/ionic-cordova-sqlite-plugin-windows-cannot-open-include-file-winapifamily-h