Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13904

[Windows] Can't run project using `cordova-plugin-globalization` with `cordova run windows`

    XMLWordPrintableJSON

Details

    Description

      Created a project with mobilespec:

       ./cordova-mobile-spec/createmobilespec/createmobilespec.js --windows --forceplugins
      

      This includes `cordova-plugin-globalization` which is causing an exception when trying to run it with `cordova run windows` as instructed by the output of mobilespec (and usual usage):

      λ cd mobilespec && cordova run windows
      ...
      Building project: C:\Projects\Cordova\mobilespec\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:\\Projects\\Cordova\\mobilespec\\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
      C:\Projects\Cordova\mobilespec\platforms\windows\CordovaApp.Windows10.jsproj(86,9): error : The following component requires .NET Native compilation which is not available when targeting ' Windows10' and 'AnyCPU'. Consider changing the targeted processor architecture to one of the following: 'x86, x64, ARM' (if you are using command line this could be done by adding '--archs ' parameter, for example: 'cordova build windows --archs=x64'). C:\Projects\Cordova\mobilespec\platforms\windows\plugins\cordova-plugin-globalization\GlobalizationProxy.winmd
      (node:13872) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): code: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe: Command failed with exit code 1 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
      (node:13872) 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.
      

      Running `cordova run windows --archs=x86` does work though.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Sujan12 Jan Piotrowski (janpio)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: