-
Notifications
You must be signed in to change notification settings - Fork 172
Build command needs to be run twice to apply config.xml changes to appxmanifest #336
Comments
Ugh, that sounds strange. Will try to reproduce. |
Hm, I think I can not reproduce this: I created the project this way:
Then I built once and commited everything to git:
Then I added the changes to diff --git a/config.xml b/config.xml
index 7434b5e..faddf6e 100644
--- a/config.xml
+++ b/config.xml
@@ -23,4 +23,11 @@
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
+
+ <platform name="windows">
+ <config-file parent="/Package/Capabilities" target="package.appxmanifest">
+ <Capability Name="allJoyn" />
+ </config-file>
+ </platform>
+
</widget>
diff --git a/platforms/windows/AppPackages/CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test/CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx b/platforms/windows/AppPackages/CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test/CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx
index 583aea4..d0bcdbc 100644
Binary files a/platforms/windows/AppPackages/CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test/CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx and b/platforms/windows/AppPackages/CordovaApp.Windows10_1.0.0.0_anycpu_debug_Test/CordovaApp.Windows10_1.0.0.0_anycpu_debug.appx differ
diff --git a/platforms/windows/build/windows/debug/anycpu/win10/AppxManifest.xml b/platforms/windows/build/windows/debug/anycpu/win10/AppxManifest.xml
index 36e605f..dc972a7 100644
--- a/platforms/windows/build/windows/debug/anycpu/win10/AppxManifest.xml
+++ b/platforms/windows/build/windows/debug/anycpu/win10/AppxManifest.xml
@@ -39,6 +39,7 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
+ <Capability Name="allJoyn" />
</Capabilities>
<build:Metadata>
<build:Item Name="SharedGUID" Value="9ebdb27f-d75b-4d8c-b53f-7be4a1fe89f9" />
diff --git a/platforms/windows/config.xml b/platforms/windows/config.xml
index e87390b..e32ba6a 100644
--- a/platforms/windows/config.xml
+++ b/platforms/windows/config.xml
@@ -15,4 +15,7 @@
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
+ <config-file parent="/Package/Capabilities" target="package.appxmanifest">
+ <Capability Name="allJoyn" />
+ </config-file>
</widget>
diff --git a/platforms/windows/package.phone.appxmanifest b/platforms/windows/package.phone.appxmanifest
index f63fb9f..42ccab2 100644
--- a/platforms/windows/package.phone.appxmanifest
+++ b/platforms/windows/package.phone.appxmanifest
@@ -35,5 +35,6 @@
</Applications>
<Capabilities>
<Capability Name="internetClientServer" />
+ <Capability Name="allJoyn" />
</Capabilities>
</Package>
diff --git a/platforms/windows/package.windows.appxmanifest b/platforms/windows/package.windows.appxmanifest
index f331373..3646983 100644
--- a/platforms/windows/package.windows.appxmanifest
+++ b/platforms/windows/package.windows.appxmanifest
@@ -35,5 +35,6 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
+ <Capability Name="allJoyn" />
</Capabilities>
</Package>
diff --git a/platforms/windows/package.windows10.appxmanifest b/platforms/windows/package.windows10.appxmanifest
index 3bfe9ba..c265ee8 100644
--- a/platforms/windows/package.windows10.appxmanifest
+++ b/platforms/windows/package.windows10.appxmanifest
@@ -32,5 +32,6 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
+ <Capability Name="allJoyn" />
</Capabilities>
</Package>
diff --git a/platforms/windows/windows.json b/platforms/windows/windows.json
index 8bd1274..c5a6807 100644
--- a/platforms/windows/windows.json
+++ b/platforms/windows/windows.json
@@ -4,7 +4,41 @@
"uninstalled": []
},
"config_munge": {
- "files": {}
+ "files": {
+ "package.phone.appxmanifest": {
+ "parents": {
+ "/Package/Capabilities": [
+ {
+ "xml": "<Capability Name=\"allJoyn\" />",
+ "count": 1,
+ "id": "config.xml"
+ }
+ ]
+ }
+ },
+ "package.windows.appxmanifest": {
+ "parents": {
+ "/Package/Capabilities": [
+ {
+ "xml": "<Capability Name=\"allJoyn\" />",
+ "count": 1,
+ "id": "config.xml"
+ }
+ ]
+ }
+ },
+ "package.windows10.appxmanifest": {
+ "parents": {
+ "/Package/Capabilities": [
+ {
+ "xml": "<Capability Name=\"allJoyn\" />",
+ "count": 1,
+ "id": "config.xml"
+ }
+ ]
+ }
+ }
+ }
},
"installed_plugins": {
"cordova-plugin-whitelist": {
That looks correct to me. Am I missing something? Note that I am using Cordova CLI |
Ping @dominic-simplan |
@janpio thank you for taking the time to investige. I can confirm your behaviour with an empty project, but I still get the described issue within my project, even with cordova 9.0.0. I've setup a new project in order to find out what's causing this issue (https://github.com/dominic-simplan/cordova-windows-config). After running cordova prepare in the linked project, windows.json contains the following (because of the camera plugin):
Now I add this to the config.xml and build the project:
The windows.json now contains
Why is the webcam capability gone?
Before I do any further investigation, I need to understand if this behaviour is correct or not. |
Interesting observation! Possible the "merging" of multiple config file changes is broken or behaving undefined. (Unfortunately I am not sure what should happen here - but sure doesn't seem good... I would have expected it to contain both, right?) (Next thing to investigate could be to just install 2 plugins that both write into the same file/path/xpath and see if these also overwrite). |
@knight9999 Might this be another case of apache/cordova#95? |
We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution. |
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:
And then building the application with
cordova build windows -- --archs="x64"
will:Running the
cordova build windows -- --archs="x64"
command a second time,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
The text was updated successfully, but these errors were encountered: