I've been struggling with this for the past 2 hours. I have a simple Ionic/Cordova app that I have working on Android and iOS. I added a windows platform and tried to build and get the following error:
Could not find SDK "Microsoft.WinJS.2.0"
I am using Visual Studio 2015 and am not super familiar, but I attempted to add a reference and it did not work. I tried installing WinJS with npm and that didn't work. I have no idea what to do. Any ideas?
I had the same issue on an app that I'm working on. I am using Windows 10 and Visual Studio 2015. My app works fine on iOS / Android. When adding Windows as a platform, I tried:
cordova platform add windows
cordova build windows
The build
step failed with the same error as above:
error MSB3774: Could not find SDK "Microsoft.WinJS.2.0, Version=1.0".
From Visual Studio, I opened the Solution file and noticed that there are 3 JS projects: one for Windows 8.1, Windows Phone 8.1 and Windows 10.0 Universal. Visual Studio could not run either of the 8.1 projects, even after I tried installing the 8.1 SDKs. However, it had no issue running the Windows 10 Universal project, which packaged its own version of WinJS not dependent on an SDK.
You can change Cordova to target Windows 10 by adding the following line to the config.xml
<preference name="windows-target-version" value="10.0" />
When you run via Cordova, it will install the app locally on your PC, which can be executed like any app from marketplace.
The HTML/JS-Apps part of the Windows (Phone) 8.1 SDK is missing. As described in this answer, you can install it as follows:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With