Enable different package names / bundle ids per platform
From @tfrenken on February 14, 2017 17:18
Ionic version: (check one with "x") [ ] 1.x [x ] 2.x
I'm submitting a ... (check one with "x") [ ] bug report [ x] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior: Ionic seems to ignore the widget:packageName config params from cordova (http://cordova.apache.org/docs/en/latest/config_ref/index.html). Thereby, all platforms either have the same bundle it or the widget:id config param in config.xml needs to be changed in order to have different. That is especially annoying when building for UWP since Microsoft has a strange naming convention for their packages which is very uncommon for typical package names on the other platforms.
Expected behavior: Config param widget:packageName should be used in config.xml as done by Cordova.
Steps to reproduce:
Put this in config.xml:
Manifest for UWP app will have "packagename.android" as package name instead of "packagename.windows".
Related code:
Other information:
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.9.3
Xcode version: Not installed
Copied from original issue: driftyco/ionic#10442
I tried to change the widget id from my config.xml to the one I received from Windows. This is what I get at the end of the build:
c:\xampp\htdocs\myproj\platforms\windows\build\windows\debug\anycpu\win8.1\AppxManifest.xml(25,18): error APPX1404: File content does not conform to specified schema. The 'Id' attribute is invalid - The value '55482Mycomp.11020F0D4B4ED' is invalid according to its datatype 'http://schemas.microsoft.com/appx/2010/manifest:ST_ApplicationId' - The Pattern constraint failed. [c:\xampp\htdocs\myproj\platforms\windows\CordovaApp.Windows.jsproj]
workaround (config.xml):
<platform name="windows">
<edit-config file="package.appxmanifest" mode="merge" target="/Package/Applications/Application">
<Application Id="packageName.windows" />
</edit-config>
</platform>
Tried out to use to workaround today. Leads to an error during the build process telling me Error: Cannot read property '_root' of undefined
I got the same error @tfrenken. Opening the app windows platform directory I noticed the appxmanifest file was named package.windows10.appxmanifest so I just changed the file attribute to that and I was able to build.
Also this: https://stackoverflow.com/questions/39200592/visual-studio-2015-cordova-windows-10-blank-white-screen-after-associated-with
This issue has been automatically closed because it had the v2 label. Please install the new CLI v3 (npm install -g ionic@latest). See CHANGELOG.md#Upgrading from CLI v2 for details.
If this issue is still a problem in CLI v3, please create a new issue. Thank you!