ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Enable different package names / bundle ids per platform

Open jgw96 opened this issue 9 years ago • 5 comments

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

jgw96 avatar Feb 14 '17 17:02 jgw96

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]

theunreal avatar Feb 15 '17 20:02 theunreal

workaround (config.xml): <platform name="windows"> <edit-config file="package.appxmanifest" mode="merge" target="/Package/Applications/Application"> <Application Id="packageName.windows" /> </edit-config> </platform>

almost92 avatar Mar 23 '17 12:03 almost92

Tried out to use to workaround today. Leads to an error during the build process telling me Error: Cannot read property '_root' of undefined

tfrenken avatar Mar 29 '17 13:03 tfrenken

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

krislm avatar Jul 17 '17 10:07 krislm

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!

imhoffd avatar Jul 28 '17 22:07 imhoffd