Coder Social home page Coder Social logo

apache / cordova-windows Goto Github PK

View Code? Open in Web Editor NEW
204.0 41.0 190.0 38.65 MB

[DEPRECATED] Apache Cordova Windows

License: Apache License 2.0

JavaScript 90.35% Batchfile 4.57% PowerShell 2.12% CSS 2.09% HTML 0.87%
cordova csharp cplusplus library objective-c java nodejs javascript mobile

cordova-windows's Introduction

📌 Deprecation Notice

This repository is deprecated and no more work will be done on this by Apache Cordova. You can continue to use this and it should work as-is but any future issues will not be fixed by the Cordova community.

Feel free to fork this repository and improve your fork. Existing forks are listed in Network and Forks.


Apache Cordova for Windows

Build status Build Status codecov.io

This repo contains the code for an Apache Cordova platform that allows you to build applications that target Windows 10, and Windows 8.1, as well as Windows Phone 8.1. An Apache Cordova based applications is written in HTML, CSS and JavaScript.

(Warning: Windows 8 has been deprecated, please update your applications to target Windows 8.1 or above)

Apache Cordova is a project of The Apache Software Foundation (ASF)

Requirements

See https://cordova.apache.org/docs/en/dev/guide/platforms/windows/index.html#requirements-and-support

Note that Visual Studio 2019 is not supported, as discussed in cordova-windows issue #327.

Getting started

The best way to use this is to install the Cordova CLI, create a project, add the windows platform, and run the app:

npm install -g cordova
cordova create test
cordova platform add windows
cordova run windows

Getting logs from Windows Store applications

You can get your JavaScript logs as well as Windows logs related to your Windows Store application by running the following command from your app directory:

platforms\windows\cordova\log

In most cases, this command requires administrator privileges. However, if you want to gather logs without admin privileges, you may need to manually enable logging channel via Event Viewer:

Start -> Run -> eventvwr
View -> Show Analytic and Debug Logs
Applications and Services Logs -> Microsoft -> Windows -> AppHost -> AppTracing -> Enable Log

Please note that the log command is supported only for Windows Store applications and cannot get logs from Windows Phone application.

Report Issues

Report them right here at GitHub using the "Issues" tab.

Further Reading

cordova-windows's People

Contributors

alsorokin avatar audreyso avatar breautek avatar bso-intel avatar cjrchang avatar cmarcelk avatar dblotsky avatar dpogue avatar dubee avatar erisu avatar filmaj avatar giuseppelt avatar janpio avatar jasongin avatar ktop avatar martincgg avatar matrosov-nikita avatar mdudek avatar mingfengwang avatar muratsu avatar nikhilkh avatar prital avatar purplecabbage avatar raphinesse avatar robpaveza avatar sgrebnov avatar shazron avatar stevengill avatar vladimir-kotikov avatar zhanghaili avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-windows's Issues

Requirements check results for windows: Windows OS: not installed

I have already made ionic app and it works on android/ios
I just wanted to add windows platform and it added successfully .
but when I call
C:\ionic2>cordova requirements
I got this
Requirements check results for windows:
Windows OS: not installed
Error: getConfig(...).getWindowsTargetVersion is not a function
(node:932) UnhandledPromiseRejectionWarning: CordovaError: Some of requirements
check failed

I don't know where is the problem ,because I build the app but it doesn't instaled in the phone.

AppVeyor CI is failing because of newer MSBuild getting selected

CI started failing when #329 was merged:

95401b3
https://ci.appveyor.com/project/Humbedooh/cordova-windows/builds/24305931

Example:

.Creating Cordova Windows Project:
	Path: temp\platforms\testcreate 応用
	Namespace: com.test.app
	Name: 応用
Windows project created with [email protected]
Building project: C:\projects\cordova-windows\temp\platforms\testcreate 応用\CordovaApp.Windows.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-windows\\temp\\platforms\\testcreate 応用\\CordovaApp.Windows.jsproj',
  '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
  '/nologo',
  '/p:Configuration=debug',
  '/p:Platform=anycpu',
  '/p:AppxBundle=Never' ] { stdio: 'inherit' }
  prebuild.js: Patching platform `8.1`
  - Injected `base.js` reference to `www/index.html`
  - Removing /( *)(<script\s+(?:type="text\/javascript"\s+)?src="\/www\/WinJS\/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:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(828,5): error APPX3217: SDK folder containing 'Windows.props' for 'Windows 8.1' cannot be located. See http://go.microsoft.com/fwlink/?LinkID=798187 for more information. [C:\projects\cordova-windows\temp\platforms\testcreate ??\CordovaApp.Windows.jsproj]
C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:155
                throw e;
                ^
CordovaError: No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1
    at C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\lib\build.js:83:29
    at _rejected (C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:864:24)
    at C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:890:30
    at Promise.when (C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:808:41)
    at C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:624:44
    at runSingle (C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:137:13)
    at flush (C:\projects\cordova-windows\temp\platforms\testcreate 応用\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)
ls: no such file or directory: C:\projects\cordova-windows\temp\platforms\testcreate 応用\AppPackages

(CordovaError: No valid MSBuild was detected for the selected target: is a known red herring here: #266)


Difference between working and broken build is this:

Before:

	MSBuildTools  : C:\Program Files (x86)\MSBuild\14.0\bin\
buildProject spawn: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild [ 'C:\\projects\\cordova-windows\\temp\\platforms\\testcreate 応用\\CordovaApp.Windows10.jsproj',

After:

	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-windows\\temp\\platforms\\testcreate 応用\\CordovaApp.Windows10.jsproj',

So improving the VS detector breaks on AppVeyor :/

No valid MSBuild was detected for the selected target

Hi,

I was suggested to open issue here [source] the issue i'm facing is that I can't make windows app and i get this error

ENV var MSBUILDDIR is set 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
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' }
C:\laragon\www\ionic\WinApp\platforms\windows\CordovaApp.Windows10.jsproj(61,13): error MSB4226: The imported project "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Microsoft\VisualStudio\v15.0\JavaScript\Microsoft.VisualStudio.WJProject.Default.props" was not found. Also, tried to find "Microsoft\VisualStudio\v15.0\JavaScript\Microsoft.VisualStudio.WJProject.Default.props" in the fallback search path(s) for $(MSBuildExtensionsPath32) - "C:\Program Files (x86)\MSBuild" . These search paths are defined in "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild.exe.Config". Confirm that the path in the <Import> declaration is correct, and that the file exists on disk in one of the search paths.
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1

What I'm using

IDE: Visual studio 2017
Cordova 9
cordova-windows 7.0.0
BuildTools 15
OS: Windows 10
Ionic 5

What I did so far

Added MSBUILDDIR in system environments
Added VSINSTALLDIR in system environments
Added path of MSBuild in system environments

Yet I'm getting error above.

Any idea what might be wrong?

Broken splashscreen image during fadeout of splashscreen

By default a new project created with Cordova Windows has a missing splashscreen:

E:\Projects\throwaway
λ cordova create cordovaWindowsMissingSplash
Creating a new cordova project.

E:\Projects\throwaway
λ cd cordovaWindowsMissingSplash\

E:\Projects\throwaway\cordovaWindowsMissingSplash  ([email protected])
λ cordova platform add https://github.com/apache/cordova-windows
Using cordova-fetch for https://github.com/apache/cordova-windows
Warning: using prerelease platform [email protected].
Use 'cordova platform add windows@latest' to add the latest published version instead.
Adding windows project...
Creating Cordova Windows Project:
        Path: platforms\windows
        Namespace: io.cordova.hellocordova
        Name: HelloCordova
Windows project created with [email protected]
Plugin 'cordova-plugin-whitelist' found in config.xml... Migrating it to package.json
Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project
Installing "cordova-plugin-whitelist" for windows
Adding cordova-plugin-whitelist to package.json

E:\Projects\throwaway\cordovaWindowsMissingSplash  ([email protected])
λ cordova run windows
ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Building project: E:\Projects\throwaway\cordovaWindowsMissingSplash\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 [
  'E:\\Projects\\throwaway\\cordovaWindowsMissingSplash\\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
  CordovaApp.Windows10 -> E:\Projects\throwaway\cordovaWindowsMissingSplash\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\Cor
  dovaApp.Windows10_1.0.0.0_anycpu_debug.appx
Deploying windows10 package to device:
E:\Projects\throwaway\cordovaWindowsMissingSplash\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx
Attempting to uninstall previous application version...
Attempting to install application...
Found package: E:\Projects\throwaway\cordovaWindowsMissingSplash\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx

Installing app...

Success: Your app was successfully installed.
Starting application...
ActivateApplication:  io.cordova.hellocordova_h35559jr9hy9m!io.cordova.hellocordova

Leads to:
image

Build command needs to be run twice to apply config.xml changes to appxmanifest

Bug Report

Problem

What is expected to happen?

Changes to the config.xml should be reflected in the AppxManifest.xml / package.*.appxmanifest file after running the build command.

What does actually happen?

Adding for example this configuration to the main config.xml:

<platform name="windows">
        <config-file parent="/Package/Capabilities" target="package.appxmanifest">
            <Capability Name="allJoyn" />
        </config-file>
    </platform>

And then building the application with cordova build windows -- --archs="x64" will:

  • Update the platforms\windows\config.xml correctly
  • Add the according element to the platforms\windows\windows.json file
  • Will not update the package.*.appxmanifest files

Running the cordova build windows -- --archs="x64" command a second time,

  • Will finally update the package.*.appxmanifest file

The build command needs to be run two times before the value is actually applied to the appxmanifest file.

Information

Environment, Platform, Device

Windows 10

Version information

Cordova 8.1.2
Cordova-windows 6.0.1 and 7.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Can not run app with `widget.name` that includes pipe `|`

Bug Report

Problem

What is expected to happen?

I want to be able to run an app with a pipe in its name for Windows similar like I can for Android.

What does actually happen?

During "Installing app" step I get this:

Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Package could not be registered. (Exception from HRESULT: 0x80073CF6)                               
                                                                                                                                                                  
NOTE: For additional information, look for [ActivityId] d145f98e-1c83-0003-9e62-50d1831cd501 in the Event Log or use the command line Get-AppPackageLog -ActivityI
d145f98e-1c83-0003-9e62-50d1831cd501                                                                                                                              
                                                                                                                                                                  
At E:\Projects\throwaway\cordovaPipeName\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\Add-AppDevPackage.ps1:396 char:13           
+             Add-AppxPackage -Path $DeveloperPackagePath.FullName -For ...                                                                                       
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                           
    + CategoryInfo          : WriteError: (E:\Projects\thr...ycpu_debug.appx:String) [Add-AppxPackage], IOException                                               
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand                                                
                                                                                                                                                                  
Error: Could not install the app.                                                                                                                                 
Starting application...                                                                                                                                           
Get-AppxPackageManifest : Cannot process argument transformation on parameter 'Package'. Object reference not set to an instance of an object.                    
At E:\Projects\throwaway\cordovaPipeName\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:157 char:41                                                       
+     $manifest = Get-appxpackagemanifest $package                                                                                                                
+                                         ~~~~~~~~                                                                                                                
    + CategoryInfo          : InvalidData: (:) [Get-AppxPackageManifest], ParameterBindingArgumentTransformationException                                         
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackageManifestCommand                   
                                                                                                                                                                  
ActivateApplication:  !                                                                                                                                           
Exception calling "ActivateApplication" with "4" argument(s): "Value does not fall within the expected range."                                                    
At E:\Projects\throwaway\cordovaPipeName\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:164 char:5                                                        
+     $appActivator.ActivateApplication($applicationUserModelId,$null,[ ...                                                                                       
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                           
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException                                                                                     
    + FullyQualifiedErrorId : ArgumentException                                                                                                                   

Information

E:\Projects\throwaway\cordovaPipeName  ([email protected]) 
λ cordova platform list                                   
Installed platforms:                                      
  android 8.0.0                                           
  windows 7.0.0                                           
Available platforms:                                      
  browser ^6.0.0                                          
  electron ^1.0.0                                         
  ios ^5.0.0                                              
  osx ^5.0.0                                              

E:\Projects\throwaway\cordovaPipeName  ([email protected])                                                                                  
λ cat config.xml                                                                                                                           
<?xml version='1.0' encoding='utf-8'?>                                                                                                     
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">    
    <name>Hello|Cordova</name>                                                                                                             
    <description>                                                                                                                          
        A sample Apache Cordova application that responds to the deviceready event.                                                        
    </description>                                                                                                                         
    <author email="[email protected]" href="http://cordova.io">                                                                       
        Apache Cordova Team                                                                                                                
    </author>                                                                                                                              
    <content src="index.html" />                                                                                                           
    <plugin name="cordova-plugin-whitelist" spec="1" />                                                                                    
    <access origin="*" />                                                                                                                  
    <allow-intent href="http://*/*" />                                                                                                     
    <allow-intent href="https://*/*" />                                                                                                    
    <allow-intent href="tel:*" />                                                                                                          
    <allow-intent href="sms:*" />                                                                                                          
    <allow-intent href="mailto:*" />                                                                                                       
    <allow-intent href="geo:*" />                                                                                                          
    <platform name="android">                                                                                                              
        <allow-intent href="market:*" />                                                                                                   
    </platform>                                                                                                                            
    <platform name="ios">                                                                                                                  
        <allow-intent href="itms:*" />                                                                                                     
        <allow-intent href="itms-apps:*" />                                                                                                
    </platform>                                                                                                                            
</widget>    

λ cordova run android
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\Jan\AppData\Local\Android\sdk (DEPRECATED)
Subproject Path: CordovaLib
Subproject Path: app
> Task :app:preBuild UP-TO-DATE
> Task :CordovaLib:preBuild UP-TO-DATE
> Task :CordovaLib:preDebugBuild UP-TO-DATE
> Task :CordovaLib:checkDebugManifest UP-TO-DATE
> Task :CordovaLib:processDebugManifest UP-TO-DATE
> Task :app:preDebugBuild UP-TO-DATE
> Task :CordovaLib:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :CordovaLib:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript UP-TO-DATE
> Task :app:checkDebugManifest UP-TO-DATE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateDebugSources UP-TO-DATE
> Task :CordovaLib:compileDebugRenderscript UP-TO-DATE
> Task :CordovaLib:generateDebugBuildConfig UP-TO-DATE
> Task :CordovaLib:generateDebugResValues UP-TO-DATE
> Task :CordovaLib:generateDebugResources UP-TO-DATE
> Task :CordovaLib:packageDebugResources UP-TO-DATE
> Task :CordovaLib:generateDebugRFile UP-TO-DATE
> Task :CordovaLib:prepareLintJar UP-TO-DATE
> Task :CordovaLib:generateDebugSources UP-TO-DATE
> Task :CordovaLib:javaPreCompileDebug UP-TO-DATE
> Task :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
> Task :CordovaLib:processDebugJavaRes NO-SOURCE
> Task :CordovaLib:transformClassesAndResourcesWithPrepareIntermediateJarsForDebug UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :app:mainApkListPersistenceDebug UP-TO-DATE
> Task :app:generateDebugResValues UP-TO-DATE
> Task :app:generateDebugResources UP-TO-DATE
> Task :app:mergeDebugResources UP-TO-DATE
> Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :app:processDebugManifest UP-TO-DATE
> Task :app:processDebugResources UP-TO-DATE
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:compileDebugNdk NO-SOURCE
> Task :app:compileDebugSources UP-TO-DATE
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders UP-TO-DATE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:mergeDebugShaders UP-TO-DATE
> Task :CordovaLib:compileDebugShaders UP-TO-DATE
> Task :CordovaLib:generateDebugAssets UP-TO-DATE
> Task :CordovaLib:packageDebugAssets UP-TO-DATE
> Task :app:mergeDebugAssets UP-TO-DATE
> Task :app:validateSigningDebug UP-TO-DATE
> Task :app:signingConfigWriterDebug UP-TO-DATE
> Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug UP-TO-DATE
> Task :app:transformDexArchiveWithDexMergerForDebug UP-TO-DATE
> Task :app:mergeDebugJniLibFolders UP-TO-DATE
> Task :CordovaLib:compileDebugNdk NO-SOURCE
> Task :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
> Task :CordovaLib:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
> Task :CordovaLib:transformNativeLibsWithIntermediateJniLibsForDebug UP-TO-DATE
> Task :app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
> Task :app:processDebugJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
> Task :app:packageDebug UP-TO-DATE
> Task :app:assembleDebug UP-TO-DATE
> Task :app:cdvBuildDebug UP-TO-DATE

BUILD SUCCESSFUL in 6s
42 actionable tasks: 42 up-to-date
Built the following apk(s):
        E:\Projects\throwaway\cordovaPipeName\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\Jan\AppData\Local\Android\sdk (DEPRECATED)
No target specified, deploying to device '02e7f7e9215da7f8'.
Using apk: E:\Projects\throwaway\cordovaPipeName\platforms\android\app\build\outputs\apk\debug\app-debug.apk
Package name: io.cordova.hellocordova
LAUNCH SUCCESS

E:\Projects\throwaway\cordovaPipeName  ([email protected])
λ cordova run windows
ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Building project: E:\Projects\throwaway\cordovaPipeName\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 [
  'E:\\Projects\\throwaway\\cordovaPipeName\\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
  CordovaApp.Windows10 -> E:\Projects\throwaway\cordovaPipeName\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu
  _debug.appx
Deploying windows10 package to device:
E:\Projects\throwaway\cordovaPipeName\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx
Attempting to uninstall previous application version...
Attempting to install application...
Found package: E:\Projects\throwaway\cordovaPipeName\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx

Installing app...
Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF6, Package could not be registered. (Exception from HRESULT: 0x80073CF6)

NOTE: For additional information, look for [ActivityId] d145f98e-1c83-0003-9e62-50d1831cd501 in the Event Log or use the command line Get-AppPackageLog -ActivityID
d145f98e-1c83-0003-9e62-50d1831cd501

At E:\Projects\throwaway\cordovaPipeName\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\Add-AppDevPackage.ps1:396 char:13
+             Add-AppxPackage -Path $DeveloperPackagePath.FullName -For ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (E:\Projects\thr...ycpu_debug.appx:String) [Add-AppxPackage], IOException
    + FullyQualifiedErrorId : DeploymentError,Microsoft.Windows.Appx.PackageManager.Commands.AddAppxPackageCommand

Error: Could not install the app.
Starting application...
Get-AppxPackageManifest : Cannot process argument transformation on parameter 'Package'. Object reference not set to an instance of an object.
At E:\Projects\throwaway\cordovaPipeName\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:157 char:41
+     $manifest = Get-appxpackagemanifest $package
+                                         ~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Get-AppxPackageManifest], ParameterBindingArgumentTransformationException
    + FullyQualifiedErrorId : ParameterArgumentTransformationError,Microsoft.Windows.Appx.PackageManager.Commands.GetAppxPackageManifestCommand

ActivateApplication:  !
Exception calling "ActivateApplication" with "4" argument(s): "Value does not fall within the expected range."
At E:\Projects\throwaway\cordovaPipeName\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:164 char:5
+     $appActivator.ActivateApplication($applicationUserModelId,$null,[ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : ArgumentException

                                                                                                                              

WinJS is not copied when adding windows platform

Bug Report

Problem

WinJS is not copied when adding windows platform to cordova application.

What is expected to happen?

The winjs\js\base.js should be copied correctly.

What does actually happen?

The winjs\js\base.js is not copied, and the console prints the error log:
cp: no such file or directory: C:\Users\i062893\cordova-workspace\attachmenttest\node_modules\cordova-windows\node_modules\winjs\js\base.js

Information

Command or Code

I use following commands:

C:\Users\i062893\cordova-workspace>cordova --version
9.0.0 ([email protected])

C:\Users\i062893\cordova-workspace>cordova create attachmenttest
Creating a new cordova project.

C:\Users\i062893\cordova-workspace>cd attachmenttest

C:\Users\i062893\cordova-workspace\attachmenttest>cordova platforms add windows
Using cordova-fetch for cordova-windows@^7.0.0
Adding windows project...
Creating Cordova Windows Project:
Path: platforms\windows
Namespace: io.cordova.hellocordova
Name: HelloCordova
cp: no such file or directory: C:\Users\i062893\cordova-workspace\attachmenttest\node_modules\cordova-windows\node_modules\winjs\js\base.js

cp: no such file or directory: C:\Users\i062893\cordova-workspace\attachmenttest\node_modules\cordova-windows\node_modules\winjs\js\base.js

Windows project created with [email protected]
Plugin 'cordova-plugin-whitelist' found in config.xml... Migrating it to package.json
Discovered saved plugin "cordova-plugin-whitelist". Adding it to the project
Installing "cordova-plugin-whitelist" for windows
Adding cordova-plugin-whitelist to package.json

Environment, Platform, Device

Version information

Cordova: 9.0.0
cordova-windows: 7.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Any problem in build process triggers "No valid MSBuild was detected for the selected target:" exception

After code restructuring this Exception is triggered a bit too often.

E.g. if just the build process in MSBuild fails:

CordovaError: No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1

This issue refers to a problem in the way the code is structured - returning an exception that is not 100% correct all the times.

Keyboard App Crashes

Bug Report

Problem

Sometimes the keyboard makes the app crashes

What is expected to happen?

The keyboard normally appears when you select an input to be filled

What does actually happen?

The keyboard NOT appears and the entire app crashes

Information

Related to issue #269

Command or Code

n.d.

Environment, Platform, Device

Tablet Samsung Galaxy Book SM-W728NZKAITV, Windows

Version information

Cordova 6.3.1
Cordova Windows 4.4.2
Ionic 1.3.2

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

Scrolling not working on Windows App when Local Mode is enabled

Hello,
I have an application which needs to run in local mode. However, as soon as I enable local mode in the config.xml by setting <preference name="WindowsDefaultUriPrefix" value="ms-appx://" />, scrolling does not work anymore (scrollbar is also not displayed):
grafik

Changing the mode back to Remote, and the scrolling works again.

Here is a repository with a simple example application:
https://github.com/dominic-simplan/cordova-scrolling

Is this a bug or am I missing some additional setting?

Blank page

I have Ionic app which so far i made android app and app is working just fine in fact it's released to google store as well, so everything is really fine with my app until I added Cordova Windows Platform in order to have another version of my app and now when I open my project on VS17 and run the app this is what I get:

ni

Blank window.

Info

OS: Windows 10
IDE: VS17
Installed Windows 10  SDK
Installed MSbuild
Installed UWP

Note: if I run command ionic cordova build windows I get:

ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
rm: could not remove directory (code ENOTEMPTY): C:\laragon\www\ionic\xxxx\platforms\windows\build/windows

rm: could not remove directory (code ENOTEMPTY): C:\laragon\www\ionic\xxxx\platforms\windows\build/windows
rm: could not remove directory (code ENOTEMPTY): C:\laragon\www\ionic\xxxx\platforms\windows\build

Building project: C:\laragon\www\ionic\xxxx\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\\xxxx\\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:\laragon\www\ionic\xxxx\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:\laragon\www\ionic\xxxx\platforms\windows\plugins\onesignal-cordova-plugin\OneSignalSDK_WP_WNS_WRTC.winmdNo valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1

And If I use VS17 I get blank screen.

Any idea what might be wrong?

CI service to build, install and run Cordova Windows apps?

Is there any CI service that can install and run Cordova Windows apps?


I tried these:

  • AppVeyor runs as Admin, which will not let you cordova run windows (and if you disable that check, you get Error: The package or bundle is not digitally signed or its signature is corrupted.)
  • Travis Windows fails with APPX0105: Cannot import the key file 'CordovaApp_TemporaryKey.pfx'. The key file may be password protected. To correct this, try to import the certificate manually into the current user’s personal certificate store.,
  • Azure Pipelines also runs as Admin, with that check disabled you get this:
     Running command: powershell -ExecutionPolicy RemoteSigned Import-Module "D:\a\1\s\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1"; Install-App "D:\a\1\s\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\Add-AppDevPackage.ps1"
     Found package: D:\a\1\s\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx
     Found certificate: D:\a\1\s\platforms\windows\AppPackages\CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test\CordovaApp.Windows10_1.0.0.0_anycpu_debug.cer
     
     Before installing this app, you need to do the following:
     	- Install the signing certificate
    
    On Windows this would also output Administrator credentials are required to continue. Please accept the UAC prompt and provide your administrator password if asked. and actually prompt you for Admin permissions.

Use `vswhere` for better Visual Studio and MSBuildTools detection

Microsoft added vswhere to the default install of Visual Studio 2017:
https://github.com/Microsoft/vswhere
https://github.com/Microsoft/vswhere/wiki/Find-MSBuild
https://docs.microsoft.com/en-us/visualstudio/install/tools-for-managing-visual-studio-instances
https://blogs.msdn.microsoft.com/heaths/2017/04/21/vswhere-is-now-installed-with-visual-studio-2017/

We already use it in appveyor.yml to debug output these paths for the CI environment. It would be handy to also use this simple command in MSBuildTools.js and similar code instead of what is currently there (which is really confusing and party bad).

Tests: `test-unit` has loads of unrelated warning output

When you run npm run test-unit you get loads of unrelated and distracting output:

> [email protected] test-unit E:\Projects\Cordova\cordova-windows
> jasmine

Started
...........................*.*.*............................Deployment completed successfully.
Deployment completed successfully.
Deployment completed successfully.
.Deployment completed successfully.
Deployment completed successfully.
Deployment completed successfully.
......................................................................................................................The following Capabilities were declared and are restricted:
        documentsLibrary
You will be unable to on-board your app to the public Windows Store with these capabilities and access rules permitting access to remote URIs.The following Capabilities were declared and are restricted:
        documentsLibrary
You will be unable to on-board your app to the public Windows Store with these capabilities and access rules permitting access to remote URIs.The following Capabilities were declared and are restricted:
        documentsLibrary
You will be unable to on-board your app to the public Windows Store with these capabilities and access rules permitting access to remote URIs....Access rules must begin with "https://", the following rule will be ignored: http://www.contoso.com
Access rules must begin with "https://", the following rule will be ignored: http://www.contoso.com
Access rules must begin with "https://", the following rule will be ignored: http://www.contoso.com
........The following image was skipped because it has an unsupported size (999x999): res/Windows/UnknownImage.png
The following image was skipped because it has an unsupported size (999x999): res/Windows/UnknownImage.png
The following image was skipped because it has an unsupported size (999x999): res/Windows/UnknownImage.png
.."res\Windows\splashscreen.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.scale-200.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.scale-200.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.scale-200.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.scale-400.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.scale-400.png" file size exceeds the limit of 204800 bytes, skipping.
"res\Windows\splashscreen.scale-400.png" file size exceeds the limit of 204800 bytes, skipping.
"res/Windows/splashscreen.scale-200.png" file size exceeds the limit of 204800 bytes, skipping.
"res/Windows/splashscreen.scale-200.png" file size exceeds the limit of 204800 bytes, skipping.
"res/Windows/splashscreen.scale-200.png" file size exceeds the limit of 204800 bytes, skipping.
"res/Windows/splashscreen.scale-400.png" file size exceeds the limit of 204800 bytes, skipping.
"res/Windows/splashscreen.scale-400.png" file size exceeds the limit of 204800 bytes, skipping.
"res/Windows/splashscreen.scale-400.png" file size exceeds the limit of 204800 bytes, skipping.
.".gif" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".gif" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".gif" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".bmp" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".bmp" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".bmp" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".tga" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".tga" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
".tga" extension is not supported, skipping. Supported image extensions are [".png",".jpg",".jpeg"]
."SplashScreen" splash screens have mixed file extensions which is not supported. Some of the images will not be used.
"SplashScreen" splash screens have mixed file extensions which is not supported. Some of the images will not be used.
"SplashScreen" splash screens have mixed file extensions which is not supported. Some of the images will not be used.
"SplashScreenPhone" splash screens have mixed file extensions which is not supported. Some of the images will not be used.
"SplashScreenPhone" splash screens have mixed file extensions which is not supported. Some of the images will not be used.
"SplashScreenPhone" splash screens have mixed file extensions which is not supported. Some of the images will not be used.
......Deploying phone package to device:
testfile
Deploying phone package to device:
testfile
Deploying phone package to device:
testfile
.Deploying windows package to device:
testfile
Deploying windows package to device:
testfile
Deploying windows package to device:
testfile
.Deploying windows package to device:
undefined
Deploying windows package to device:
undefined
Deploying windows package to device:
undefined
.Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
.Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
Deploying undefined package to device:
undefined
.............

Pending:

1) run method spec.8 should fail buildProject if built with MSBuildTools version 4.0
  Temporarily disabled with xit


2) run method spec.10 should throw an error if windows-target-version has unsupported value
  Temporarily disabled with xit


3) run method spec.12 should throw an error if windows-phone-target-version has unsupported value
  Temporarily disabled with xit

217 specs, 0 failures, 3 pending specs
Finished in 11.912 seconds

Most of this could probably be avoided.

Visual Studio and other requirements error messages are not optimal

When these were created it was only VS2013 and VS2015, Windows 10 also was not a thing. Because of this the error message of the requirement checks in multiple places output quite confusing instruction on what to do or install.

Unfortunately what to actually do is really complicated and so not easy to fix.

Ability to override TargetPlatformVersion via config.xml

Feature Request

Motivation Behind Feature

The CordovaApp.Windows10.jsproj template file has a hard-coded TargetPlatformVersion, which currently seems to be set to 10.0.10240.0:

  <PropertyGroup>
    <TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
    <TargetPlatformVersion>10.0.10240.0</TargetPlatformVersion>
    <TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
    <MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
    <UapDefaultAssetScale>100</UapDefaultAssetScale>
  </PropertyGroup>

However, when I try to build my project, which should target 10.0.15063.0, I get build failures as the wrong platform version is targeted and the SDK for this version is not available to Visual Studio:

D:\MyApp>cordova build windows --arch=x86
ENV var VSINSTALLDIR is set C:\Program Files (x86)\Programming\Microsoft Visual Studio 2017
Building project: D:\MyApp\platforms\windows\CordovaApp.Windows10.jsproj
        Configuration : debug
        Platform      : x86
        Buildflags    : /p:AppxBundle=Never
        MSBuildTools  : C:\Program Files (x86)\Programming\Microsoft Visual Studio 2017\MSBuild\15.0\Bin
buildProject spawn: C:\Program Files (x86)\Programming\Microsoft Visual Studio 2017\MSBuild\15.0\Bin\msbuild [ 'D:\\MyApp\\platforms\\windows\\CordovaApp.Windows10.jsproj',
  '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
  '/nologo',
  '/p:Configuration=debug',
  '/p:Platform=x86',
  '/p:AppxBundle=Never' ] { stdio: 'inherit' }
C:\Program Files (x86)\Programming\Microsoft Visual Studio 2017\MSBuild\Microsoft\VisualStudio\v15.0\JavaScript\Microsoft.VisualStudio.JavaScript.UAP.targets(84,3): error : "
10.0.10240.0" is not a supported value for TargetPlatformVersion. Please change it on the Project Property page. [D:\MyApp\platforms\windows\CordovaApp.Windows10.jsproj]
No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Programming\Microsoft Visual Studio 2017\MSBuild\15.0\Bin\msbuild.exe: Command failed with
 exit code 1

I can fix this by manually editing platforms\windows\CordovaApp.Windows10.jsproj to change this line, but I was under the impression that anything in the 'platforms' folder shouldn't be touched, as it may get replaced when building/cleaning/updating.

Feature Description

There are various settings that can be added to config.xml that look like they should influence this, but none of them seem to resolve the issue:

        <preference name="windows-target-version" value="10.0" />
        <preference name="windows-appx-target" value="uap" />
        <preference name="windows-phone-target-version" value="10.0" />
        <preference name="windows-phone-target-platform-version" value="10.0.15063.0" />
        <preference name="Windows.Universal-MinVersion" value="10.0.15063.0" />
        <preference name="Windows.Mobile-MinVersion" value="10.0.15063.0" />

I would expect that using one of these settings, or a new setting for this specific purpose, would ensure the correct build is performed.

Alternatives or Workarounds

I have been able to fix this by manually editing the file, but this doesn't appear to be a sustainable solution for the reasons given.

Other notes

I have logged this as a feature request, but it might actually be considered a bug.

The basic issue is to provide a way to tell Visual Studio to build using the correct SDK, and as there appear to be settings to control this that aren't being applied in this instance. If the existing settings are not working as intended, this is a bug. If this is not currently intended to be configurable, then this is a feature request.

Or, if there is already some way to achieve this that I have been unable to find via the online documentation 1, 2, then perhaps this is a documentation bug.

Config details

  • Cordova 8.1.2
  • Cordova-Windows 6.0.1
  • Visual Studio 2017
  • OS: Windows 8.1

MSBuild v4.0 Not supported and possibly why all these other MSBuild issues are happening.

Hello, looking through the open issues I think we're all facing somewhat similar versions of the same problem with MSBuildTool. #266, #267, #272, #273 are all versions of problems finding the correct MSBuild path.

I'm running Ionic 3.20.0 Cordova 8.0.0 and Cordova-Windows 6.0.0 as well as a fresh install of Windows 10 pro and Visual Studio Community 2017

When I run cordova windows build or cordova windows run I get essentially the same issue:

C:\Users\dennis\Source\Repos\showman-ionic>cordova build windows
Skip!
MSBuild v4.0 is not supported, aborting.
(node:2108) UnhandledPromiseRejectionWarning: CordovaError: No valid MSBuild was detected for the selected target: Package with specified parameters not found in AppPackages folder
    at C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\lib\build.js:83:29
    at _rejected (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:864:24)
    at C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:808:41)
    at C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:624:44
    at runSingle (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:137:13)
    at flush (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:2108) 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:2108) [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.

I read through everyones issues (even some in german) and #267 is correct that any failure will throw the error either in the CLI or using visual studio, BUT when run inside Visual Studio it doesn't have the errors related to missing or unsupported MSBuild.

When I run cordova build windows --verbose

C:\Users\dennis\Source\Repos\showman-ionic>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:\Users\dennis\Source\Repos\showman-ionic\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  www\assets\base\base.css platforms\windows\www\assets\base\base.css (updated file)
//
// *** Copying truncated for clarity ***///
//
  copy  www\service-worker.js platforms\windows\www\service-worker.js (updated file)
Updating icons and splash screens at platforms\windows\images
Prepared windows project successfully
No scripts found for hook "pre_package".
Executing script found in plugin com-intel-security-cordova-plugin for hook "after_prepare": plugins\com-intel-security-cordova-plugin\src\windows\ChooseArch_Windows.js
No scripts found for hook "before_compile".
Reading build config file: C:\Users\dennis\Source\Repos\showman-ionic\build.json
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
Skip!
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 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\12.0,/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.
(node:9592) UnhandledPromiseRejectionWarning: CordovaError: No valid MSBuild was detected for the selected target: Package with specified parameters not found in AppPackages folder
    at C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\lib\build.js:83:29
    at _rejected (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:864:24)
    at C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:808:41)
    at C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:624:44
    at runSingle (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:137:13)
    at flush (C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\cordova\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:131:7)
    at process._tickCallback (internal/process/next_tick.js:180:9)
(node:9592) 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:9592) [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.

So it seems it can't find my MSBuild info at all. That got me looking around and I found:
VS 2017 Does not put items into the registry
which is the method cordova-windows uses to look for the path. (at least on my machine)

So it goes down the registry list and then finds the MSBuild for .NET which is way old I guess and it bails.

When run inside VS, VS I guess handles this or I'm not exactly sure what's happening. I'm 3 days into Windows Build Voodoo.

Other folks are on fresh machines too, and only install 2017, which NEVER places any info in the registry so it'll likely show as failed...

I have one thing left to try solution wise but I'm at my limit skillset wise on going much deeper on my own. Let me know what you need / suggest I try and I'll for sure do it..

Probably unrelated but I also saw my CordovaApp.Windows10.jsproj is still targeting v14:
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

Which Seems it could be bumped to 15 if 2017 is the new Req

Troubles with template/Properties/Default.rd.xml

Continuation of apache/cordova-discuss#106 which is now closed:

cordova-windows has suffered from the following issues with template/Properties/Default.rd.xml that was introduced in GH-228 (CB-12499):

  • CB-13834 - problem building with build with params --release --bundle --archs="x64 x86 arm" on AppVeyor CI which remains unsolved
  • CB-14224 - running coho audit-license-headers -r windows gives a message that template/Properties/Default.rd.xml is missing the license header (already solved in GH-284 [master] and GH-285 [6.0.x patch])
  • CB-14225 - misspelling in sample Namespace serialize attribute name (with solution in GH-286)

It is clear from CB-12499 that Default.rd.xml was introduced to solve a problem but it is unfortunately the actual circumstances are not so clear to me. The following observations indicate to me that Default.rd.xml should only be needed in case of a project using C# which I think is not always the case:

Given the observed troubles and what I think are limited circumstances of need I would like to propose that we remove template/Properties/Default.rd.xml at some point in the future, as a major release item, and support it in a plugin if needed.

Can I build and run windows platform with device or simulator flag in mac os?

I want to dev windows mobile in mac os. So I create windows platform with command 'cordova platform add windows', but when I try to build or run with command 'cordova build/run windows', It will failed with error 'No valid MSBuild was detected for the selected target.'

Visual studio 2017 for mac is installed and added dotnet and msbuild to environment path.
Cordova (Cordova CLI) : 8.0.0
Cordova Platforms : ios 4.5.4 windows 6.0.0
OS: macOS High Sierra
Xcode : Xcode 9.4.1 Build version 9F2000

Change build config options

When I build for windows using the CLI I get the following messages

λ cordova build windows
ENV var MSBUILDDIR is set C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin
Building project: D:\M - AEROMETRIX\E - ProductDesign\G - Tablet\Cordova\AexPAD\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 [ 'D:\M - AEROMETRIX\E - ProductDesign\G - Tablet\Cordova\AexPAD\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**

How can I change the Configuration:debug; Paltform:anycpu and /nologo options ?

Thanks

Cordova UWP Plugin with a UIElement

Hey everyone ,
Currently i have a Cordova plugin and a UWP Class library. The library is using native UIElements for different UI workflows. Is there a way to display those UIElements? I read, that XAML views can't be displayed. Is there a workaround somehow?
Maybe we can put the WebView in the background in fire up a native View. If yes, how do we get the current page, like in Android (cordova.getActivity())?
Thanks in advance!

SplashScreen tag name does not match entry in Windows 10 Manifest file on some devices

The Windows 10 Manifest uses the uap namespace for UAP/UWP tags. The following tag name for UWP in confighelper.js does not match the SplashScreen tag in that manifest, a modified uap:SplashScreen tag name does.

var splashScreenTagName = isWin10UWP ? "SplashScreen" : (isPhone ? "m3:SplashScreen" : "m2:SplashScreen");

var splashScreenTagName = isWin10UWP ? "SplashScreen" : (isPhone ? "m3:SplashScreen" : "m2:SplashScreen");

Results in undefined access when retrieving splash screen image path etc. which causes a bunch of other issues ...

Don't know what the reason behind the differing behavior is, maybe the Windows 10 build version. Version 10.0.17736 requires the uap namespace, version 10.0.17134 is only ok without the namespace, same app build.

Why can't Cordova Windows be run in an admin prompt?

During testing on how to get Paramedic to run on Appveyor CI for Windows, so we can properly test the Windows parts of the plugins in CI, this code blocks running apps:

// Check if ran from admin prompt and fail quickly if CLI has administrative permissions
// http://stackoverflow.com/a/11995662/64949
if (ranWithElevatedPermissions()) {
return Q.reject(new CordovaError('Can not run this platform with administrative ' +
'permissions. Must be run from a non-admin prompt.'));
}

It was added back in 2015 by @muratsu with this commit: b34a5f1

The JIRA issue was https://issues.apache.org/jira/browse/CB-9097 which mentions that "cordova run will fail for windows if invoked from admin prompt. Currently we will wait until ActivateApplication stage and fail afterwards." but unfortunately does not contain a sample of such an error.

(https://issues.apache.org/jira/browse/CB-10266 is a related JIRA issue, but only has the last bits of an error message - the end result being that ActivateApplication doesn't work, but the cause is missing as well)

I manually tried disabling this check (see https://github.com/apache/cordova-windows/tree/janpio-admin), and surprisingly had no problem building, deploying and running a Cordova Windows app from an admin prompt.

Are you still around @muratsu and maybe remember why this was added?
Did Microsoft maybe change things around so it now works? Or am I maybe doing something different that makes this work?


@knight9999 You helped me debug similar problems in the past, could you maybe try my branch https://github.com/apache/cordova-windows/tree/janpio-admin and see if you can add that to a new Cordova project (cordova platform add https://github.com/apache/cordova-windows#janpio-admin) and see if you can build and run the app in an elevated/admin prompt? That would be awesome.

Fix MSBuild/SDK vs. Visual Studio confusion

Although the build process is done by MSBuild and needs some SDKs installed, in lots of places this is represented by "Visual Studio". Yes, Visual Studio comes with MSBuild and the SDKs can be installed there, but still this is not correct. By mixing these, it can become confusing what is missing and why.

description tag set to default instead of defined value - regression from 5.0.0

The <description> tag is set to a default value instead of the in the config.xml defined value. This is is a regression from cordova-windows 5.0.0.

situation

macOS host machine
cordova-lib: 8.1.0
cordova-windows 6.0.0

A description is correctly set in config.xml:

config.xml

  <description>
    Demo
  </description>

when running on a mac (or windows):

cordova prepare

actual

platforms/windows/config.xml contains an additional description tag (with default content), in addition to the customized description tag

  <description>
    A sample Apache Cordova application that responds to the deviceready event.
  </description>
  [...]
  <description>
    Demo
  </description>

The appxmanifest files contain only the default value instead of the set custom value:
platforms/windows/package.phone.appxmanifest
platforms/windows/package.windows.appxmanifest
platforms/windows/package.windows10.appxmanifest

-        <Description>Demo</Description>
+        <Description>A sample Apache Cordova application that responds to the deviceready event.</Description>
-            <m2:VisualElements Description="Demo" DisplayName="Demo">
+            <m2:VisualElements Description="A sample Apache Cordova application that responds to the deviceready event." DisplayName="Demo">

expected

the correctly set description tag gets propagated.

conditions

  • happens only with cordova-windows 6.0.0 - doesn't happen when using cordova-windows 5.0.0 with an otherwise unchanged setup

  • happens on mac & windows - however this a serious problem, as the generated code could be committed by mistake

  • probable cause: in 6.0.0 the platforms/windows/cordova/defaults.xml contains a default value for the desciption tag for the first time.

The wrong description value comes form the defaults.xml, however the <name> and <author> tags get processed correctly:
platforms/windows/cordova/defaults.xml

    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>

One specific spec fails on AppVeyor with VS2017

This test fails, although it shouldn't:

Failures:
1) Cordova create and build spec.6a should generate appxupload and appxbundle for Windows 10 project bundle release build
  Message:
    Expected 1 to be 3.
  Stack:
    Error: Expected 1 to be 3.
        at _expectExist (C:\projects\cordova-windows\spec\e2e\endtoend.spec.js:53:97)
        at UserContext.<anonymous> (C:\projects\cordova-windows\spec\e2e\endtoend.spec.js:243:9)
  Message:
    Expected 0 to be 1.
  Stack:
    Error: Expected 0 to be 1.
        at verifySubDirContainsFile (C:\projects\cordova-windows\spec\e2e\endtoend.spec.js:46:90)
        at _expectSubdirAndFileExist (C:\projects\cordova-windows\spec\e2e\endtoend.spec.js:60:9)
        at UserContext.<anonymous> (C:\projects\cordova-windows\spec\e2e\endtoend.spec.js:244:9)
19 specs, 1 failure
Finished in 271.36 seconds

Only happens on AppVeyor.

window.requestFileSystem

My project works fine on Android and Windows 10
But I've an issue with Win10 for accessing to the FileSystem

The project is configured with [email protected] and [email protected]
When I try to use window.requestFileSystem, it is always undefined.

Is there something specific to configure in config.xml or something like that ?

"You Can't Add Both..." for AppxManifest.xml

I'm trying to recover being able to build from my main repo and not having to open the solution in the platform every time.

When trying to run my (default) build I keep getting this error:

MakeAppx : error : You can't add both "C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\build\windows\debug\x86\win10\Upload\AppxManifest.xml" and "C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\build\windows\debug\x86\win10\ilc\AppxManifest.xml" to the output file as "AppxManifest.xml". [C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\CordovaApp.Windows10.jsproj]

I deleted the entire build folder, it add's the files and does it every time. No Idea how to stop it or where it's configured...

Windows 10 Min Version Must Be Configured Twice in Config.xml

[Originally reported in https://issues.apache.org/jira/browse/CB-13917 ]

In config.xml, the minimum Windows 10 version preference must be set with both:

  uap-target-min-version
  Windows.Universal-MinVersion

Setting uap-target-min-versio results in the value being copied to CordovaApp.Windows10.jsproj.

Setting Windows.Universal-MinVersion results in the value being copied to package.windows10.appxmanifest.

If uap-target-min-version is not set, the minimum version of the app in the Microsoft Store is incorrect.

Development of Windows 10 apps would be simplified by only having to set the minimum version in one place.

Keyboard Access Violations in cordova windows 5.0.0

my project is running [email protected]. Everything works fine on all platforms, apart from on one Windows phone that is running 10.0.15254.248. The other windows phone I have, which is running: 10.0.14393.2068, runs it perfectly fine.

Whenever you click on an input, and then type a key, it instantly crashes the app, with the following exception:

JavaScript runtime error: Unable to get property 'handleEvent' of undefined or null reference
The program '[7608] WWAHost.exe' has exited with code -1073741819 (0xc0000005) 'Access violation'.

A previous version of the app installed on the same phone works fine, however this is an old build and I have no access to this code. I have tried reverting to the last code I have and the issue still persists, and have updated and reverted versions as best I can to try and find a working combination.

Has anyone come across this before? Below is the offending HTML - just a standard input.

<label for="x" class="y">Input your z</label>

The specified path, file name, or both are too long

Hello there,

I stumbled over an issues with Ionic 4 and the cordova build. In debug mode, the js module filenames are getting, depending on your project setup, quiet big. In Prod releases, they get uglified. So there will be less of a problem.

C:\develop\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(3704,5): error MSB3021: Unable to copy file "C:\swarm\workspace\very-long-directory-path\platforms\windows\www\default~features-path-to-module-file-and-module-name~c9a3cc5b.js" to "build\windows\bld\PackageLayout\www\default~path-to-module-file-and-module-name~c9a3cc5b.js". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\swarm\workspace\very-long-directory-path\platforms\windows\CordovaApp.Windows10.jsproj]

So to fix that, we addressed the issue with the long dir name. My Jenkins generates the dir automatically and uses the last git hash with about 50 characters. We removed that, and were under that Windows limit.

So I guess, this is more or less a workaround for the problem itself. I'm not really sure how Windows long path thing works, but here is a link to the official docu. Maybe this could help to eliminate any error in that direction.

Best regards,
Fabiryn

Build command does not report correct status code

cordova build windows and cordova run windows do not report an error even when the build clearly failed:

https://travis-ci.org/janpio/cordova-windows-ci/builds/555130991

...
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\BuildTools\MSBuild\15.0\Bin\msbuild [ 'C:\\Users\\travis\\build\\janpio\\cordova-windows-ci\\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\BuildTools\MSBuild\15.0\Bin\msbuild C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj /clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal /nologo /p:Configuration=debug /p:Platform=anycpu /p:AppxBundle=Never
Command finished with error code 1: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj,/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal,/nologo,/p:Configuration=debug,/p:Platform=anycpu,/p:AppxBundle=Never
CordovaError: No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1
    at C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\cordova\lib\build.js:83:29
    at _rejected (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:864:24)
    at C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:808:41)
    at C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:624:44
    at runSingle (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:137:13)
    at flush (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:61:11)
The command "cordova build windows --verbose" exited with 0.
...
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\BuildTools\MSBuild\15.0\Bin\msbuild [ 'C:\\Users\\travis\\build\\janpio\\cordova-windows-ci\\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\BuildTools\MSBuild\15.0\Bin\msbuild C:\Users\travis\build\janpio\cordova-windows-ci\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
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2519,5): warning APPX0105: Cannot import the key file 'CordovaApp_TemporaryKey.pfx'. The key file may be password protected. To correct this, try to import the certificate manually into the current user’s personal certificate store. [C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2519,5): warning APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2638,5): error APPX0002: Task 'ValidateAppxManifest' failed. Retrieving the COM class factory for component with CLSID {5842A140-FF9F-4166-8F5C-62F5B7B0C781} failed due to the following error: 8007045a A dynamic link library (DLL) initialization routine failed. (Exception from HRESULT: 0x8007045A). [C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj]
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2638,5): error APPX0002:  [C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj]
Command finished with error code 1: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\CordovaApp.Windows10.jsproj,/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal,/nologo,/p:Configuration=debug,/p:Platform=anycpu,/p:AppxBundle=Never
CordovaError: No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\msbuild: Command failed with exit code 1
    at C:\Users\travis\build\janpio\cordova-windows-ci\platforms\windows\cordova\lib\build.js:83:29
    at _rejected (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:864:24)
    at C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:890:30
    at Promise.when (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:1142:31)
    at Promise.promise.promiseDispatch (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:808:41)
    at C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:624:44
    at runSingle (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:137:13)
    at flush (C:\Users\travis\build\janpio\cordova-windows-ci\node_modules\q\q.js:125:13)
    at process._tickCallback (internal/process/next_tick.js:61:11)
The command "cordova run windows --verbose" exited with 0.

Build does not really fail on "MSBuild v4.0 is not supported, aborting."

On a system with no correct Visual Studio installed or path variables for MSBuild discovery set, the build often stops with MSBuild v4.0 is not supported, aborting.. It seems this is just an output, not a real error. This causes Paramedic not to fail properly although the build did not work as expected.

config-file tag removed from config.xml is not removed from appxmanifest

Bug Report

Problem

What is expected to happen?

Removing a <config-file> element from the config.xml should be reflected in the AppxManifest.xml / package.*.appxmanifest file after running the build command.

What does actually happen?

Having for example this configuration in the main config.xml:

<platform name="windows">
        <config-file parent="/Package/Capabilities" target="package.appxmanifest">
            <Capability Name="allJoyn" />
        </config-file>
    </platform>

And then removing this element and building the application with cordova build windows -- --archs="x64" will:

  • Update the platforms\windows\config.xml correctly
  • Not remove the according element from the platforms\windows\windows.json file
  • Not remove the according Capability element from the package.*.appxmanifest files

Information

Environment, Platform, Device

Windows 10

Version information

Cordova 8.1.2
Cordova-windows 6.0.1 and 7.0.0

Might be related to #336.
Not sure if this is a bug or if I am expected to readd the platform after making changes to the config.xml file... in case of the latter, feel free to close these two issues...

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

MsBuild Tool not found

I had a problem with the MSBuild Tool for building an ionic project for windows.
The reason for the problem might be that I have installed both, Visual Studio Professional 2017 and Visual Studio Community 2017.

After adding the windows platform with cordova platform add [email protected] I got the following output when trying to compile with ionic cordova build windows:

Building project: C:\Users\Lukas\Desktop\Schulapp\Schulapp\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\\Lukas\\Desktop\\Schulapp\\Schulapp\\platforms\\windows\\CordovaApp.Windows10.jsproj',
  '/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal',
  '/nologo',
  '/p:Configuration=debug',
  '/p:Platform=anycpu',
  '/p:AppxBundle=Never' ] { stdio: 'inherit' }
C:\Users\Lukas\Desktop\Schulapp\Schulapp\platforms\windows\CordovaApp.Windows10.jsproj(61,5): error MSB4019: Das importierte Projekt "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\Micr
osoft.VisualStudio..Default.props" wurde nicht gefunden. Vergewissern Sie sich, dass der Pfad in der <Import>-Deklaration korrekt und die Datei auf dem Datenträger vorhanden ist.
(node:9196) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): code: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1 No valid MSBuild was detected for the selected target: Error: C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe: Command failed with exit code 1

This line 61 says:

<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\$(WMSJSProjectDirectory)\Microsoft.VisualStudio.$(WMSJSProject).Default.props" />

Ionic info says:

cli packages: (C:\Users\Lukas\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : windows 6.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node : v6.11.5
    npm  : 3.10.10
    OS   : Windows 10

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

cordova platform list says:

Installed platforms:
  windows 6.0.0
Available platforms:
  android ~7.0.0
  browser ~5.0.1
  ios ~4.5.4
  osx ~4.0.1
  www ^3.12.0

After adding the environment variable MSBUILDDIR to C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin it worked.

For additional information and the complete solution path please look at https://forum.ionicframework.com/t/windows-10-sdk-missing/126215/12

compile to window exe

Can cordova be compiled to generate window 'exe' file ?

I would like to use cordova compile project to window exe.
Does it support it ?

base.js not copied when adding windows platform @7.0.0

Bug Report

Problem

What is expected to happen?

The Windows platform should be added without errors.

What does actually happen?

The following error is logged (twice):
cp: no such file or directory: C:\Temp\test\node_modules\cordova-windows\node_modules\winjs\js\base.js

Information

If you create a new cordova project and then try to add the windows platform version 7.0.0
the following output is logged:

Using cordova-fetch for [email protected]
Adding windows project...
Creating Cordova Windows Project:
        Path: platforms\windows
        Namespace: io.cordova.hellocordova
        Name: HelloCordova
cp: no such file or directory: C:\Temp\test\node_modules\cordova-windows\node_modules\winjs\js\base.js

cp: no such file or directory: C:\Temp\test\node_modules\cordova-windows\node_modules\winjs\js\base.js

Windows project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for windows
Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
--save flag or autosave detected
Saving windows@~7.0.0 into config.xml file ...

It seems as if the paths to the base.js file are not resolved properly. They should be C:\Temp\test\node_modules\winjs\js\base.js instead of C:\Temp\test\node_modules\cordova-windows\node_modules\winjs\js\base.js

Command or Code

cordova create test
cd test
cordova platform add [email protected]

Environment, Platform, Device

Windows 10 Enterprise Version 1809 Build 17763.379

Version information

Cordova 8.1.2 ([email protected])

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

VS2019 drops .jsproj (UWP JS) support, VS2017 keeps working

Bug Report

Problem

Cordova Windows projects no longer function in the latest Visual Studio release (2019).

What is expected to happen?

Cordova Windows Visual Studio solutions open, compile, and deploy successfully using the latest Visual Studio release.

What does actually happen?

None of the above.

Information

Command or Code

cordova run windows

Environment, Platform, Device

The official Visual Studio 2019 release drops all support for JavaScript UWP projects. Per it’s release notes:

UWP JavaScript apps are no longer supported in Visual Studio 2019. You cannot create or open JavaScript UWP projects (files with extension jsproj).

As best as I can tell, the only two paths forward for Cordova apps using .NET plugins are 1) Cordova-Electron + Edge.js, or 2) writing a custom UWP host with a full-screen WebView (perhaps using WebView.Interop.

Version information

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above

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.