Coder Social home page Coder Social logo

Comments (10)

janpio avatar janpio commented on May 29, 2024 2

Please make sure you have the necessary workloads and products installed: https://cordova.apache.org/docs/en/dev/guide/platforms/windows/index.html#visual-studio-2017

from cordova-windows.

janpio avatar janpio commented on May 29, 2024

What version of Visual Studio 2017 are you using?
What values did you set the env vars to?

from cordova-windows.

robertnicjoo avatar robertnicjoo commented on May 29, 2024

@janpio

01

system info

Ionic:

   Ionic CLI                     : 5.0.1 (C:\laragon\bin\nodejs\node-v11\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.4.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : windows 7.0.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 4.0.1, (and 4 other plugins)

Utility:

   cordova-res : 0.3.0
   native-run  : 0.2.2

System:

   Android SDK Tools : 26.1.1 (C:\Users\Theo\AppData\Local\Android\sdk)
   NodeJS            : v11.10.0 (C:\laragon\bin\nodejs\node-v11\node.exe)
   npm               : 6.7.0
   OS                : Windows 10

Project package.json

"dependencies": {
   //....
    "cordova-windows": "7.0.0",
    //....
  },
"cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "windows"
    ]
  }

Environment

02
03

Hope it helps

from cordova-windows.

robertnicjoo avatar robertnicjoo commented on May 29, 2024

@janpio i just installed the sdk

vc

here is the result:

ENV var VSINSTALLDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community
Building project: C:\laragon\www\ionic\WinApp\platforms\windows\CordovaApp.Windows10.jsproj
        Configuration : debug
        Platform      : anycpu
        Buildflags    : /p:AppxBundle=Never
        MSBuildTools  : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
buildProject spawn: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild [ 'C:\\laragon\\www\\ionic\\WinApp\\platforms\\windows\\CordovaApp.Windows10.jsproj',
  '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
  '/nologo',
  '/p:Configuration=debug',
  '/p:Platform=anycpu',
  '/p:AppxBundle=Never' ] { stdio: 'inherit' }
  prebuild.js: Patching platform `10`
  - Injected `base.js` reference to `/www/index.html`
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
No valid MSBuild was detected for the selected target: AppPackages folder doesn't exist

from cordova-windows.

janpio avatar janpio commented on May 29, 2024

That's better.

"Universal Windows Platform development" Workload also selected?

If so try cordova run windows --archs=x86.

Also try to build with --verbose to see if you get additional output.

from cordova-windows.

robertnicjoo avatar robertnicjoo commented on May 29, 2024

@janpio

"Universal Windows Platform development" Workload also selected?

Where should i select that?

from cordova-windows.

janpio avatar janpio commented on May 29, 2024

On the "Workloads" tab, see the screenshot on https://cordova.apache.org/docs/en/dev/guide/platforms/windows/index.html#visual-studio-2017

from cordova-windows.

robertnicjoo avatar robertnicjoo commented on May 29, 2024

@janpio yes i start to download it sorry for that anyway here is the result of --verbose

Prepared windows project successfully
No scripts found for hook "after_prepare".
No scripts found for hook "before_compile".
getLatestMatchingMSBuild
getLatestMSBuild
ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Running command: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild -version -nologo
Command finished with error code 0: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild -version,-nologo
Using MSBuild v15.9 from C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Building project: C:\laragon\www\ionic\WinApp\platforms\windows\CordovaApp.Windows10.jsproj
        Configuration : debug
        Platform      : anycpu
        Buildflags    : /p:AppxBundle=Never
        MSBuildTools  : C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Running command: reg query HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows /s /v InstallationFolder /reg:32
Command finished with error code 0: reg query,HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows,/s,/v,InstallationFolder,/reg:32
buildProject spawn: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild [ 'C:\\laragon\\www\\ionic\\WinApp\\platforms\\windows\\CordovaApp.Windows10.jsproj',
  '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
  '/nologo',
  '/p:Configuration=debug',
  '/p:Platform=anycpu',
  '/p:AppxBundle=Never' ] { stdio: 'inherit' }
Running command: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild C:\laragon\www\ionic\WinApp\platforms\windows\CordovaApp.Windows10.jsproj /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=debug /p:Platform=anycpu /p:AppxBundle=Never
  prebuild.js: Patching platform `10`
  - Injected `base.js` reference to `/www/index.html`
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.WinJS.2.0\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/\/Microsoft.Phone.WinJS.2.1\/js\/base.js">\s*<\/script>)(\s*)/ from /www/index.html
Command finished with error code 0: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild C:\laragon\www\ionic\WinApp\platforms\windows\CordovaApp.Windows10.jsproj,/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal,/nologo,/p:Configuration=debug,/p:Platform=anycpu,/p:AppxBundle=Never
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:\laragon\www\ionic\WinApp\platforms\windows\cordova\lib\build.js:83:29
    at _rejected (C:\laragon\www\ionic\WinApp\node_modules\q\q.js:844:24)
    at C:\laragon\www\ionic\WinApp\node_modules\q\q.js:870:30
    at Promise.when (C:\laragon\www\ionic\WinApp\node_modules\q\q.js:1122:31)
    at Promise.promise.promiseDispatch (C:\laragon\www\ionic\WinApp\node_modules\q\q.js:788:41)
    at C:\laragon\www\ionic\WinApp\node_modules\q\q.js:604:44
    at runSingle (C:\laragon\www\ionic\WinApp\node_modules\q\q.js:137:13)
    at flush (C:\laragon\www\ionic\WinApp\node_modules\q\q.js:125:13)
    at processTicksAndRejections (internal/process/next_tick.js:74:9)

from cordova-windows.

robertnicjoo avatar robertnicjoo commented on May 29, 2024

@janpio

Thanks for the helps man it's working now after installing "Universal Windows Platform development"

Here I'd like to share process step by step for others in future.

  1. Install VS17 (vs19 won't work)
  2. Install MSBuild from VS17 Installation
  3. Install SDK 10 from VS17 Installation
  4. Install Universal Windows Platform development from VS17 Installation
  5. Install cordova globally
  6. Install cordova-windows platform
  7. Last but not least restart your system otherwise you still get the errors

Hope it helps to ease the process for others with the same issue.

from cordova-windows.

janpio avatar janpio commented on May 29, 2024

You can probably skip step 2 - the general MSBuild should not be required and probably do more harm than good.

But great it now works for you ❀️

from cordova-windows.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.