Build Failed after adding Kapsel Plugins to Cordova Project - Could not find SDK "Microsoft.VCLibs, Version=12.0" - windows

I'm trying to make a Windows Cordova build using cmd but I'm getting below errors. Can any of you please guide me on how to fix this issue.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\Microsoft.Common.CurrentVersion.targets(
2377,5): error MSB3774: Could not find SDK "Microsoft.VCLibs, Version=12.0".
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe: Command failed with exit code 1
PS: I'm using Visual Studio Community 2017.

Related

Ionic / Cordova Windows build picking up incorrect MSBUILD path

I have had to do a few update of Visual Studio on my Windows 10 machine (after some licensing issues).
I use to have Visual Studio Enterprise 2017, which I uninstalled. I now have Visual Studio Professional 2017, and Studio Enterprise 2019 (which I recently installed). I also installed Visual Studio Build Tools 2019 (2).
Now, when I try to build my Ionic project via the command I have always used...
ionic cordova build windows --prod --release -- --archs="x86 x64 arm" --buildConfig=platform_build_files\\windows\\build.config
I now get the error...
Building project: D:\dev\myapp\platforms\windows\CordovaApp.Windows10.jsproj
Configuration : release
Platform : x86
Buildflags : /p:AppxBundle=Never,/p:UapAppxPackageBuildMode=StoreUpload
MSBuildTools : C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin
buildProject spawn: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild [ 'D:\\dev\\myapp\\platforms\\windows\\CordovaApp.Windows10.jsproj', '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
'/nologo',
'/p:Configuration=release',
'/p:Platform=x86',
'/p:AppxBundle=Never',
'/p:UapAppxPackageBuildMode=StoreUpload' ] { stdio: 'inherit' }
The system cannot find the path specified.
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild: Command failed with exit code ENOENT
Of course I no longer have a folder C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise as I uninstalled it.
I have removed and readded the windows platform for my Ionic app, but this did not help.
Also, I am not sure if this is related, but when I try to open the CordovaApp.sln in Visual Studio 2019, I get the following...
Not sure if related.
My question is, how can I reset this MSBuild path? I cannot see any environmental variables anywhere for this, I just can't get rid of this old path
Edit 1
I added the env var as suggested:
Opened a new command prompt, but it is still looking for the non-existent path
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\msbuild: Command failed with exit code ENOENT
In Visual Studio 2019, creating UWP apps using Javascript is no longer supported, if you want to build UWP apps using web technologies like Cordova. You need to use Visual Studio 2017.
My question is, how can I reset this MSBuild path?
Visual Studio will choose the version of MSBuild without explicit settings, but you can change this by setting environment variables.
Please add the path of MSBuild to the system environment variable, like:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Best regards.

Ionic cordova build windows throw *MSBUILD* error

When i run ionic cordova build windows it throws error like-
> cordova build windows
ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise
Building project: C:\Users\shail\Desktop\ionic-demo\ionic-4-windows\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\\shail\\Desktop\\ionic-demo\\ionic-4-windows\\platforms\\windows\\CordovaApp.Windows10.jsproj',
'/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
'/nologo', '/p:Configuration=debug', '/p:Platform=anycpu', '/p:AppxBundle=Never'] { stdio: 'inherit' } C:\Users\shail\Desktop\ionic-demo\ionic-4-windows\platforms\windows\CordovaApp.Windows10.jsproj(61,5): error MSB4019: The imported project "C:\Program Files(x86)\MSBuild\Microsoft\VisualStudio\v14.0\Microsoft.VisualStudio..Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild: Command failed with exit code 1
is any one can help to resolve this problem.
ionic -v is 4.12.0
cordove -v is 9.0.0
installed platform
cordova platforn list
Installed platforms:
android 8.0.0
windows 7.0.0
Using Visual Studio 2017 Enterprise
According to the error message: The path of your msbuild tool is
invalid.
1.As for vs2017, the msbuild you use should be C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin instead of C:\Program Files (x86)\MSBuild\14.0\bin.
2.Also, v14.0 is for vs2015 while v15.0 for vs2017, please change all 'v14.0' in your setting to 'v15.0' and run it.

How to build SCOM 2012 management pack using msbuild?

I have a Visual Studio project which I'm building with Visual Studio and everything works fine. When I'm trying to build it using msbuild.exe /t:Build F:\BuildSource\SCOMManagementPacks\2012\Packs.sln I'm getting the following errors:
C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(223,5): error MSB4018: T
he "VerifyManagementPackFragment" task failed unexpectedly.\r [F:\BuildSource\SCOMManagementPacks\2012\Zabbix.Linux.
Library\Zabbix.Linux.Library.mpproj]
C:\Program Files (x86)\MSBuild\Microsoft\VSAC\Microsoft.SystemCenter.OperationsManager.targets(223,5): error MSB4018: System.IO.FileNotFoundException: Could not find file 'F:\BuildSource\SCOMManagementPacks\2012\Zabbix.Linux.Library\Fr
agmentSchemaOM20.xsd'.\r [F:\BuildSource\SCOMManagementPacks\2012\Zabbix.Linux.Library\Zabbix.Linux.Library.mppro
j]
There's no such file on my original machine where I was building the solution using Visual Studio and everything's building fine.
How can I fix this?

Xamarin Studio Build Error File 'Windows.Props' not found

I just downloaded Xamarin studio but when I try to compile the code it gets this error:
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AppxPackage\
Microsoft.AppXPackage.Targets(9,9):
Error APPX1639: File 'Windows.props' not found.
See http://go.microsoft.com/fwlink/?prd=12395&pver=1.0&plcid=0x409&ar=MSDN&sar=PlatformMultiTargeting&o1=
C:\Program Files (x86)\Microsoft SDKs\Portable\v12.0&o2=Portable for more information. (APPX1639) (ToDo)
I already installed the sdk for Windows 10, and tried to repair the app but nothing happened.

Visual Studio Empty Cordova Multi Device Hybrid App Build Failure [error code 8]

Having tried to follow all advices, remedies and workarounds including removing and reinstalling the Multi-Device Hybrid Apps for Visual Studio CPT1 I still can't seem to do a successful build of the included "Blank App (Apache Cordova)" project.
Build ends consistently in one single error:
The command ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7
\IDE\Extensions\k04kuuo3.ie0\packages\vs-mda\install" "C:\Program Files (x86)
\nodejs\" "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7
\IDE\Extensions\k04kuuo3.ie0\packages\vs-mda"" exited with code 8.
File %USERPROFILE%\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets
Line 108
Column 5
Project BlankCordovaApp1
Environment settings:
ADT_HOME %USERPROFILE%\AppData\Local\Android\android-sdk
ANT_HOME C:\apache-ant-1.9.3
GIT_HOME C:\Program Files (x86)\Git\cmd
JAVA_HOME C:\Program Files (x86)\Java\jdk1.7.0_55
PATH %JAVA_HOME%\bin;%ANT_HOME%\bin;%ADT_HOME%\platform-tools;%ADT_HOME%\tools;
C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Windows Kits\8.1\Windows
Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;
C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\
(contains no reference to "Platform")
Your kind help is very much appreciated, Thanks Ian
I just ran into this on one of my PCs and here's how I got it fixed:
Quit Visual Studio
Open the Android SDK manager by typing the Windows key and then "SDK manager", hit enter
Install Android Build Tools Rev 19 by checking the box next to it and clicking Install packages
Accept the license
Open Visual Studio and your project, then run it again
Jordan (Microsoft, Multi-Device Hybrid Apps tools team)
Finally the light bulb went on for me: The problem was the install batch files not being able to locate xcopy.exe and therefore the simple remedy was to just extend the path variable with
%SystemRoot%\system32;
The build now runs without further errors.
Thanks Jordan and Ian.
I ended up doing both.
I ran the Android SDK manager to install the Android Build Tools Rev 19 as well as some other updates.
I also added "%SystemRoot%\system32;" to the PATH environment variable.
Everything running as it should.

Resources