Hi, I just wanted to compile my ionic app for windows 10.
So I typed ionic cordova build windows.
And I get this:
(node:1284) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Windows SDK not found. Ensure that you have installed Windows 8.1 SDK along with Visual Studio or install Windows 8.1 SDK separately from https://dev.windows.com/en-us/downloads
The Problem: I did install the Windows SDK. Is it a problem, that I installed the Windows 10 SDK instead of the 8.1? What shall I do?
Hi, thanks for your answer!
The output of ionic info is
cli packages: (C:\Users\Lukas\AppData\Roaming\npm\node_modules)
@ionic/cli-utils : 1.19.2
ionic (Ionic CLI) : 3.20.0
global packages:
cordova (Cordova CLI) : 8.0.0
local packages:
@ionic/app-scripts : 3.1.8
Cordova Platforms : none
Ionic Framework : ionic-angular 3.9.2
System:
Node : v6.11.5
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : not set
Misc:
backend : pro
The output of ionic cordova requirements is:
Requirements check results for windows:
Windows OS: installed Windows 10
MSBuild Tools: installed 14.0
Visual Studio: not installed
Required version of Visual Studio not found. Please install Visual Studio 2013 Express for Windows Update2 from https://www.visualstudio.com/downloads/download-visual-studio-vs
Windows SDK: not installed
Windows SDK not found. Ensure that you have installed Windows 8.1 SDK along with Visual Studio or install Windows 8.1 SDK separately from https://dev.windows.com/en-us/downloads
Windows Phone SDK: not installed
Windows Phone SDK not found. Ensure that you have installed Windows Phone 8.1 SDK along with Visual Studio or install Windows Phone 8.1 SDK separately from https://dev.windows.com/develop/download-phone-sdk
(node:11960) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Some of requirements check failed
Here it says that the Windows SDK is not installed. But I did install it! Is there any environment variable to set maybe?
I added the platform now and builded it withcordova build windows. I still get an error.
Building project: C:\Users\Lukas\Desktop\Schulapp\Schulapp\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : anycpu
Buildflags : /p:AppxBundle=Never
MSBuildTools : C:\Program Files (x86)\MSBuild\14.0\bin
buildProject spawn: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild [ 'C:\\Users\\Lukas\\Desktop\\Schulapp\\Schulapp\\platforms\\windows\\CordovaApp.Windows10.jsproj',
'/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
'/nologo',
'/p:Configuration=debug',
'/p:Platform=anycpu',
'/p:AppxBundle=Never' ] { stdio: 'inherit' }
C:\Users\Lukas\Desktop\Schulapp\Schulapp\platforms\windows\CordovaApp.Windows10.jsproj(61,5): error MSB4019: Das importierte Projekt "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Micr
osoft.VisualStudio..Default.props" wurde nicht gefunden. Vergewissern Sie sich, dass der Pfad in der <Import>-Deklaration korrekt und die Datei auf dem Datenträger vorhanden ist.
(node:9196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): code: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1 No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin exists? If so, set the env var MSBUILDDIR to that value and then try again.
(The selection mechanism might be confused by having both Enterprise and Community at the same time - I never tested this and I assume it is not a very common setup. Is it?)
No it might not be I first installed the community version because its free and then I got the professional version for free and installed it too. So now I got both.
I set the system variable to that value (the directory exists). There has not even been a variable called MSBUILDDIR before.
The error is still thrown
C:\Users\Lukas\Desktop\Schulapp\Schulapp>ionic cordova build windows
Running app-scripts build: --platform windows --target cordova
[20:46:51] build dev started ...
[20:46:51] clean started ...
[20:46:51] clean finished in 9 ms
[20:46:51] copy started ...
[20:46:51] deeplinks started ...
[20:46:52] deeplinks finished in 38 ms
[20:46:52] transpile started ...
[20:46:59] transpile finished in 7.83 s
[20:46:59] preprocess started ...
[20:46:59] preprocess finished in 79 ms
[20:47:00] webpack started ...
[20:47:01] copy finished in 9.13 s
[20:47:22] webpack finished in 21.94 s
[20:47:22] sass started ...
Without `from` option PostCSS could generate wrong source map and will not find Browserslist config. Set it to CSS file path or to `undefined` to prevent this warning.
[20:47:24] sass finished in 2.07 s
[20:47:24] postprocess started ...
[20:47:24] postprocess finished in 30 ms
[20:47:24] lint started ...
[20:47:24] build dev finished in 32.49 s
> cordova build windows
[20:47:29] lint finished in 5.73 s
Building project: C:\Users\Lukas\Desktop\Schulapp\Schulapp\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : debug
Platform : anycpu
Buildflags : /p:AppxBundle=Never
MSBuildTools : C:\Program Files (x86)\MSBuild\14.0\bin
buildProject spawn: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild [ 'C:\\Users\\Lukas\\Desktop\\Schulapp\\Schulapp\\platforms\\windows\\CordovaApp.Windows10.jsproj',
'/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
'/nologo',
'/p:Configuration=debug',
'/p:Platform=anycpu',
'/p:AppxBundle=Never' ] { stdio: 'inherit' }
C:\Users\Lukas\Desktop\Schulapp\Schulapp\platforms\windows\CordovaApp.Windows10.jsproj(61,5): error MSB4019: Das importierte Projekt "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Microsoft.VisualStudio..Default.props" wurde nicht gefunden. Vergewissern Sie sich, dass der Pfad in der <Import>-Deklaration korrekt und die Datei auf dem Datentr�ger vorhanden ist.
(node:14856) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): code: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1 No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1
The output indicates it didn’t catch. Did you restart your command line?
You can use SET MSBUILDDIR in the command line to check if it is recognized.
If this also doesn’t work, you can set the env var VSINSTALLDIR to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\ and try that one - although this should not be necessary.
Thank you very much! It worked after I restarted my CLI.
The build was successful and a new directory was created. One last question: I have never worked with windows apps - which of those files is that one I should start to test the app? Because there is no .exe file…?