Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

cordova build windows generates following error "Error: No valid MSBuild was detected for the selected target." #273

Closed
vincent-at-684857612710 opened this issue Apr 12, 2018 · 4 comments
Labels

Comments

@vincent-at-684857612710

cordova platform list
Installed platforms: browser 5.0.3, ios 4.5.4, osx 4.0.1, windows 5.0.0
Available platforms: amazon-fireos, android, blackberry10, firefoxos, webos

cordova -v
5.4.0

I have tried this on Mac High Sierra as well as Windows 10

@janpio
Copy link
Member

janpio commented Apr 12, 2018

Uh - current cordova version is 8.0.0 and current cordova-windows is 6.0.0 - you should try updating both. (Instructions here for example: https://ionic.zone/cordova/update)

Then run cordova requirements to get some (hopefully) useful output on the system requirements and dependencies.
What Visual Studio do you have installed?

@vincent-at-684857612710
Copy link
Author

vincent-at-684857612710 commented Apr 12, 2018

This is the whole error generated::

cordova build windows
Before deploy hook started...
Checking is node modules installed...
Node modules already installed.
Starting webpack build...
Webpack build completed to www folder successfully!
Cordova hook completed. Resuming to run your cordova command...
The following navigation rule had an invalid URI scheme and will be ignored: "*".
(node:44560) UnhandledPromiseRejectionWarning: CordovaError: No valid MSBuild was detected for the selected target.
at buildTargets (//app/platforms/windows/cordova/lib/build.js:298:25)
at //app/platforms/windows/cordova/lib/build.js:71:16
at _fulfilled (app/platforms/windows/cordova/node_modules/q/q.js:834:54)
at self.promiseDispatch.done (app/platforms/windows/cordova/node_modules/q/q.js:863:30)
at Promise.promise.promiseDispatch (//app/platforms/windows/cordova/node_modules/q/q.js:796:13)
at /app/platforms/windows/cordova/node_modules/q/q.js:604:44
at runSingle (//app/platforms/windows/cordova/node_modules/q/q.js:137:13)
at flush (/app/platforms/windows/cordova/node_modules/q/q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:176:11)
(node:44560) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:44560) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@AngelCareaga
Copy link

My temporary solution has been only to execute it in debug mode and not in release mode.

At the time of generating the compiled for the store does not happen, it works perfectly. I will continue to see the same log to see what is happening.

@shazron
Copy link
Member

shazron commented Aug 15, 2018

Essentially the MSBuild detection code does not work well with VS 2017. Duping this into #274

@shazron shazron closed this as completed Aug 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants