Comments (8)
@janpio thanks. I solved it by using environment variable MSBUILDDIR
from cordova-windows.
cordova-windows
uses multiple methods to try to figure out a matching MSBuild version - it's quite a mess and very brittle code, so I am not too surprised it is not working all the time. (But with a default 2017 install - an probably without .NET MSBuild installed - it should definitely work)
If it can only find the 4.0, your easiest solution is probably to use the MSBUILDDIR
or VSINSTALLDIR
environment variables mentioned in the blog post here: https://cordova.apache.org/announcements/2018/02/27/cordova-windows-6.0.0.html Set them and try again, this should override the internal logic.
from cordova-windows.
@janpio
I had similar issue where the build for windows just failed to detect MSBuild.
VS2017 and cordova-windows 6.0.0 did the trick.
Thanks a bunch.
from cordova-windows.
The location of MSBuild for VS 2017 has changed, and can be several of them.
In the past (until Visual Studio 2015), the path of MSBuild was “C:\Program Files (x86)\MSBuild\<version>”, where <version> was “4.0”, “12.0” (VS 2013), “14.0” (VS 2015).
There is no “15.0” folder there for VS 2017. Instead, MSBuild for VS 2017 is installed in the folder “C:\Program Files (x86)\Microsoft Visual Studio\2017\<edition>\MSBuild\15.0”, where edition can be “Community”, “Professional” or “Enterprise”.
Again, for your own use on your own build script you can hardcode the path, but if you want to use a more proper way, you need to get the VS 2017 installation folder as explained above and concatenate “MSBuild\15.0”.
Or you can wait until Microsoft releases a document about how to resolve MSBuild location (they are working on it and now that MSBuild is open source you can follow the progress on GitHub). BTW, you can download the MSBuild Tools for Visual Studio 2017 RC here.
So, to have auto-detect working properly we need to add more locations to check as per the article, and only rely on the registry as a fallback. I had VS 2017 Community installed, and it only detected MSBuild v4 from the .NET Framework so I had to use the MSBUILDDIR env var.
from cordova-windows.
So is there a definitive solution for this?
from cordova-windows.
I am facing a similar issue (I installed universal windows platform build tools15.8.7 on window 10):
MSBuild v4.0 is not supported, aborting.
No valid MSBuild was detected for the selected target: AppPackages folder doesn't exist
C:\work\hello-cordova>cordova requirements
Requirements check results for windows:
Windows OS: installed Windows 10
MSBuild Tools: not installed
MSBuild tools v.14.0 not found. Please install Visual Studio 2015 Community or higher from https://www.visualstudio.com/downloads/download-visual-studio-vs
Visual Studio: installed 15.8
Windows SDK: installed 10.0
Windows Phone SDK: installed 10.0
Some of requirements check failed
C:\work\hello-cordova>cordova build windows --verbose
No scripts found for hook "before_build".
No scripts found for hook "before_prepare".
Checking config.xml and package.json for saved platforms that haven't been added to the project
Config.xml and package.json platforms are the same. No pkg.json modification.
Package.json and config.xml platforms are different. Updating config.xml with most current list of platforms.
PlatformApi successfully found for platform windows
Checking config.xml for saved plugins that haven't been added to the project
Checking for any plugins added to the project that have not been installed in windows platform
No differences found between plugins added to project and installed in windows platform. Continuing...
Generating platform-specific config.xml from defaults for windows at C:\work\hello-cordova\platforms\windows\config.xml
Merging project's config.xml into platform-specific windows config.xml
Merging and updating files from [www, platforms\windows\platform_www] to platforms\windows\www
copy platforms\windows\platform_www\cordova-js-src\confighelper.js platforms\windows\www\cordova-js-src\confighelper.js (updated file)
copy platforms\windows\platform_www\cordova-js-src\exec.js platforms\windows\www\cordova-js-src\exec.js (updated file)
copy platforms\windows\platform_www\cordova-js-src\platform.js platforms\windows\www\cordova-js-src\platform.js (updated file)
copy platforms\windows\platform_www\cordova_plugins.js platforms\windows\www\cordova_plugins.js (updated file)
copy www\css\index.css platforms\windows\www\css\index.css (updated file)
copy www\index.html platforms\windows\www\index.html (updated file)
copy www\js\index.js platforms\windows\www\js\index.js (updated file)
This app does not have any icons or splash screens defined
Prepared windows project successfully
No scripts found for hook "pre_package".
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
getLatestMatchingMSBuild
getLatestMSBuild
Searching for available MSBuild versions...
Running command: C:\windows\system32\reg.exe query HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.5 /v MSBuildToolsPath
Running command: C:\windows\system32\reg.exe query HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.0 /v MSBuildToolsPath
Running command: C:\windows\system32\reg.exe query HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0 /v MSBuildToolsPath
Running command: C:\windows\system32\reg.exe query HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0 /v MSBuildToolsPath
Running command: C:\windows\system32\reg.exe query HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0 /v MSBuildToolsPath
Command finished with error code 1: C:\windows\system32\reg.exe query,HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0,/v,MSBuildToolsPath
Command finished with error code 1: C:\windows\system32\reg.exe query,HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\14.0,/v,MSBuildToolsPath
Command finished with error code 1: C:\windows\system32\reg.exe query,HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.0,/v,MSBuildToolsPath
Command finished with error code 1: C:\windows\system32\reg.exe query,HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\15.5,/v,MSBuildToolsPath
Command finished with error code 0: C:\windows\system32\reg.exe query,HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0,/v,MSBuildToolsPath
Found MSBuild v4.0 at C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
Using MSBuild v4.0 from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
MSBuild v4.0 is not supported, aborting.
No valid MSBuild was detected for the selected target: AppPackages folder doesn't exist
CordovaError: No valid MSBuild was detected for the selected target: AppPackages folder doesn't exist
at C:\work\hello-cordova\platforms\windows\cordova\lib\build.js:83:29
at _rejected (C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:864:24)
at C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:890:30
at Promise.when (C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:1142:31)
at Promise.promise.promiseDispatch (C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:808:41)
at C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:624:44
at runSingle (C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:137:13)
at flush (C:\work\hello-cordova\platforms\windows\cordova\node_modules\q\q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:61:11)
from cordova-windows.
@edenprojectde No.
@samuelchen Open a new issue and include all available environment information of your system.
from cordova-windows.
MSBUILDDIR
and VSINSTALLDIR
are indeed the solution here if VS17 can not detect MSBuild for any reason. apache/cordova-docs#976 will add this to the documentation.
from cordova-windows.
Related Issues (20)
- JavaScript UWP development from VS 2019 not supported HOT 1
- JavaScript UWP development from Visual Studio 2019 not supported HOT 1
- Can't cordova build or run platform windows with Visual Studio 2017 HOT 3
- use @cordova/eslint-config HOT 1
- META: start major release 8.0.0 with some breaking changes HOT 1
- Can we use target minimum windows SDK version 10.0.16299.0 HOT 1
- Error: WebGL not supported HOT 2
- Windows: uap capability included when building for 8.1 HOT 1
- Using Chrome-based webview as rendering backend for Cordova for Windows instead of EdgeHTML HOT 2
- comma as decimal separator on ```<input type="number"> ``` HOT 1
- window.alert , prompt, confirm not working, please help me it is an emergency. Please please help me urgently.🙏🏻🙏🏻🙏🏻🙏🏻 HOT 1
- The following navigation rule had an invalid URI scheme and will be ignored: "*". HOT 1
- Microsoft Surface hybrid touch events HOT 1
- Absolute (root relative) paths do not resolve to www folder, instead point to C:\... HOT 3
- Cordova installation problem HOT 2
- Running HelloWorld throws an error HOT 2
- package.windows10.appxmanifest does not set the correct descriptions as in config.xml HOT 1
- instructions from https://cordova.apache.org for platform Windows erroneous HOT 1
- The processor architecture of your project 'arm' doesn’t match the processor architecture 'x86' of the referenced project 'SQLite3.UWP'. HOT 1
- shelljs 0.5.3 is vulnerable HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cordova-windows.