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 Apostrophe in product name breaks iOS builds with Xcode 14.2

Discussion in 'Editor & General Support' started by Rabadash8820, May 25, 2023.

  1. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    87
    Hello, sorry if this channel isn't the right place; I didn't see one specifically for build issues. I recently started using Xcode 14.2 (experimental) in Unity Build Automation, and my iOS builds started failing. While the UBA logs were not very helpful, I was able to reproduce a build failure locally with Xcode 14.2, and the issue I got was something about missing a closing apostrophe in the
    Pods/Target Support Files/Pods-Unity-iPhone/Pods-Unity-iPhone-frameworks.sh
    file generated by Unity's build process (or possibly by Google's External Dependency Manager for Unity, I'm not positive). The problematic line was this one in the
    code_sign_if_enabled
    shell function:

    Code (CSharp):
    1. local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'"
    The
    $1
    variable apparently includes the project's Product Name, which in my case had an apostrophe. Manually changing the apostrophes around
    $1
    on that line to escaped double quotes (
    \"
    ) fixed the error. However, making this change would be pretty difficult in UBA, so for now I've just removed the apostrophe from my product name for testing, but I would really like to bring it back. Hopefully this can be addressed as part of the work going into making Xcode 14.2 not "experimental".
     
  2. tomfulghum

    tomfulghum

    Joined:
    May 8, 2017
    Posts:
    69
    In my experience, using symbols other than - and _ in names is generally a bad idea and should be avoided. There's always gonna be that one library that doesn't sanitize their inputs.
     
    Rabadash8820 and Kurt-Dekker like this.
  3. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    In my experience if you use anything but A to Z or 0 to 9 in your filenames / folders, you are one cruddy little piece of middleware away from losing your ability to build the project.

    Use A-Z and 0-9 ONLY for filenames and directories. Even SPACE is problematic. If you're VERY brave and feeling young and invulnerable, perhaps sprinkle in and underscore (_) but that's on you when it fails.
     
    Rabadash8820 likes this.
  4. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    87
    Ya, all good points. I do generally avoid characters other than [A-Za-z0-9_-] in file paths, but I hadn't realized that the Product Name was used in a file path before now. I thought the Product Name was only used as the name of the built executable (i.e., as the name that shows on device home screens). I'm making a little Poker-style card game, and had really been hoping to use "Hold'em" in that name. Special chars don't seem totally unprecedented in app names; looking on my phone, e.g., I see "Romeo's Pizza", "Disney+", and "QR & Barcode Scanner" to name a few. I guess those apps just weren't built with Unity.
     
  5. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,713
    It might not even be that... it could be a limitation of the appname in xcode, which I know is different from the limitations imposed by Android, which is different from ... etc.

    That's why you gotta think cross platform when you're working in Unity: least common denominator always.

    It's also possible that Romeo's Pizza uses something OTHER than a single quote... like a UTF-8 nightmare.

    Lots of companies add little tiny UTF-8 dots and accents to be able to use a popular name such as "Slots"
     
    Rabadash8820 likes this.
  6. Rabadash8820

    Rabadash8820

    Joined:
    Aug 20, 2015
    Posts:
    87
    Ha, wow, I've never heard of that. Crazy.

    Well in this case I know it was a path issue due to the fix I found with that
    Pods-Unity-iPhone-frameworks.sh
    file, but yeah I see your point about using the "least common denominator". I won't lose sleep over changing "Hold'em" to "Holdem" lol (Wikipedia even shows it as a valid alternate spelling). Just wanted to raise awareness to Unity devs about this specific issue.