Customizing bundle identifier in iOS and Android

Hi,

I’m naive to ionic. I am encountering a weird problem in this. I am trying to customize the bundle identifier manually through config.xml file in the top folder but it isn’t allowing me to do so. It is throwing the following error:
Error parsing /Users/rival/myApp/config.xml: Error: Invalid attribute name
Line: 1
Column: 43
Char: 0 (CLI v1.6.5)

isn’t there any command similar to cordova in ionic for creating user defined bundle identifier and appname

cordova create testapp com.testing.testapp “testapp” (similar to this command)

If there isn’t any could you please help me out how to create a customized bundle identifier for my app.

1 Like

Can you post contents of config.xml here ?

Please go through the above images the first one is before changing the config.xml and the second one is after changing the config.xml
If there is anything else i need to post to give u a proper clarification regarding my problem do let me know

Is there any space or a line before this line ?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Check the closing double quotes in the second example. It doesn’t match the opening quotes.

"   U+0022 QUOTATION MARK
“   U+201C LEFT DOUBLE QUOTATION MARK
”   U+201D RIGHT DOUBLE QUOTATION MARK

@ashwin5103 did you manage to solve it?

@mrameezraja no there isn’t any space before that line. Sorry for the delay in reply. I managed to change the app name for iOS though

@tomkuipers Apologies for the delay in reply and i am sorry there isn’t any change in the quotes though because i haven’t made any changes to the quotes. Meanwhile i am still not finding any way to get user defined identifier please let me know if you come to find any

Okay, you changed myapp649503 to TestApp, so maybe your editor appended the right quote.

"com.ionicframework.myapp649503" <-- this right quote is not same as right quote in --> "com.ionicframework.TestApp”

As an alternative you could try to replace the complete element with the following. Afterwards build your project again.

<widget id="com.ionicframework.TestApp" version="0.0.2" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">

It is possible to set your custom package id when your create a project. On the command line type:

cordova create mydir my.domain.test myapp

Check your custom id in config.xml:

less mydir/config.xml

The output will look like:

<widget id="my.domain.test" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>myapp</name>
2 Likes

@tomkuipers hmmm isn’t that the cordova command u typed out above does that even work for ionic…? and ya what you pointed out is correct regarding the quotations … Thank You…

@ashwin5103 Yes, ionic is sort of extra services on top of cordova. When you want to install ionic first you have to install cordova, it’s a dependency: http://ionicframework.com/docs/guide/installation.html

@tomkuipers ya it is a dependency but i wasn’t sure that “cordova create mydir my.domain.test my app” this command can also be used in ionic for creating app name.

[in iOS]

Replaced double quote for id as in other attribute values, by copying the other attributes double quotes.

Works for me. :slight_smile: