Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Bug Invalid characters have been removed from the Application Identifier

Discussion in 'iOS and tvOS' started by PeachyPixels, Mar 18, 2022.

  1. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
    Hello!

    I've just updated a project from 2020.3.20f1 to 2020.3.31f1 and after changing one of the project settings (unrelated to this issue) a warning (attached) is now showing in the settings window.

    Source control confirms that Unity has changed the App Identifier from...

    com.companyname.productname

    to

    com.company-name.productname

    There were no invalid characters in the id and Unity has added a hyphen in the middle of the company name. The issue is for iOS only.

    I know it's possible to override this to workaround the issue, but it still looks like a bug to me.
     

    Attached Files:

  2. Petras-Unity

    Petras-Unity

    Unity Technologies

    Joined:
    Oct 7, 2020
    Posts:
    24
    Hi, it definitely looks like a bug. Could you register it trough bug reporter?
     
    PeachyPixels likes this.
  3. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
    Bug report filed (Case 1412412)
     
  4. bianca-stana

    bianca-stana

    Unity Technologies

    Joined:
    Jan 26, 2021
    Posts:
    14
    Hi David,

    Thank you for reporting this case! I looked at it but I need a little bit more information.

    First, could you please clarify where do you see the problem? Is it the warning that is shown, the change of the Application Identifier after the upgrade, or both?

    Second, the default Application Identifier is created based on the Company Name and the Product Name set in the Player settings (in the Project Settings window) – could you please share the values of those fields in your project?

    Thank you!
     
  5. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
  6. bianca-stana

    bianca-stana

    Unity Technologies

    Joined:
    Jan 26, 2021
    Posts:
    14
    Hi David,

    I am aware of that, and this behaviour seems to be by design. That is why I still need that information – to confirm if this is really a bug or the expected behaviour. :)

    Thank you!
     
    publicvoidTTV likes this.
  7. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
    Hi @bianca-stana

    The error shows in the Project Settings -> Player -> iOS section (Windows & Android appear to be unaffected)

    Originally "Override Default Bundle Identifier" was unticked and Unity had auto-filled the Bundle Identifier with com.companyname.productname

    After the update, the error now shows and Unity has changed the auto-filled bundle identifier to com.company-name.productname

    Changing the bundle identifier (especially without any sort of prompting) is going to cause problems with uploads to the app store etc.

    The project company name is two parts (i.e. Company Name) and identifiers do not allow spaces. So I suspect the bug is that Unity now incorrectly changes the space to a hyphen, where-as before it just stripped the space.

    So Company Name results in Company-Name but it should actually be CompanyName

    The workaround is to tick the override option and manually specify the identifier. Tbh it's probably better to specify it that way anyway.

    I hope that make sense.
     
  8. bianca-stana

    bianca-stana

    Unity Technologies

    Joined:
    Jan 26, 2021
    Posts:
    14
    Hi David,

    Thank you very much for the clarifications.

    Starting with 2020.3.31f1, the intended behaviour is the following: all invalid characters (including spaces) in the Application Identifier for Standalone, iOS and tvOS will be replaced with hyphens (similar to Xcode's behaviour). Starting with 2020.3.33f1, this will be done for all platforms except Android, where the behaviour will continue to be the same because the hyphen itself is considered an invalid character on Android.

    This has been done in order to prevent having missing segments in the default Application Identifier in case either the Company Name or the Product Name contains only invalid characters (which is the case mostly for names written in other alphabets). The warning is there just to inform you that invalid characters have been removed from the default Application Identifier, so it won't mirror the Company Name and the Product Name exactly. In case the Application Identifier itself is invalid, then an error will be displayed instead of a warning.

    As always, the Application Identifier for each platform will be updated only when opening the Player settings of the corresponding platform. If the default Application Identifier is not the desired one, it can always be changed after checking the setting Override Default Bundle Identifier (or Override Default Package Name, for Android).

    It is true that we should have informed our users about this breaking change, and I will make sure to fix that.

    Thank you again for reporting this case and for all the details. If you have any questions, concerns, or feedback, please don't hesitate to share them!
     
  9. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    678
    Hi Bianca,

    Thanks for the update.

    The reason I say this is a bug is because it overwrites valid App Id's. That's how I discovered it originally.

    On upgrading to 32f1, I was committing an unrelated change to source control and spotted the following delta in the project settings file...

    -: iPhone: com.companyname.productname
    +: iPhone: com.company-name.productname

    As you can see, Unity had already persisted a valid App Id to the settings file. It didn't need to be updated.

    I suspect the Unity logic doesn't take into account the existing App Id. It just looks at the Company Name & Product Name (to see if they contain invalid characters) and overwrites existing App Id's (even if they're still valid)

    Hope that helps!
     
    Last edited: Apr 7, 2022
  10. bianca-stana

    bianca-stana

    Unity Technologies

    Joined:
    Jan 26, 2021
    Posts:
    14
    Hi David,

    I completely understand your concern, so I've discussed this with my team. We've concluded that the current behaviour is correct, while the old one was wrong.

    This change has been done in order to prevent having missing segments in the default Application Identifier in case either the Company Name or the Product Name contains only invalid characters. If the default Application Identifier is not the desired one, it can always be changed after checking the setting Override Default Bundle Identifier.

    For more details, please check our documentation on iOS Player settings: Identification.

    Thank you!