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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Resolved Post-Export Process Not Seeing Files In App Contents

Discussion in 'Unity Build Automation' started by JonathanBartel, Oct 6, 2022.

  1. JonathanBartel

    JonathanBartel

    Joined:
    Jun 24, 2019
    Posts:
    45
    For my Mac builds to be valid, I need to run a post-export re-sign due to a Chromium plugin I use. For the past year or so, I've used a post-export script that searches the Contents/PlugIns/ folder of the built app, signs the bundles in there, then resigns the app.

    Code (CSharp):
    1. foreach (var file in Directory.GetFiles($"{appPath}/Contents/PlugIns"))
    2.     UnityEditor.OSXStandalone.MacOSCodeSigning.CodeSignAppBundle($"{appPath}/Contents/PlugIns/{file}");
    3.  
    4. UnityEditor.OSXStandalone.MacOSCodeSigning.CodeSignAppBundle($"{appPath}");
    This has worked great until recently. Now, it seems that the plugin bundle is no longer being signed. At runtime startup, I get this error in the console:

    [1006/082107.891446:ERROR:gl_implementation.cc(551)]
    code signature in <4C4C44E5-5555-3144-A1B3-96B91ED344AD> not valid for use in process:
    mapping process and mapped file (non-platform) have different Team IDs)


    This error message is a little hard for me to interpret, but I understand this to be a signature issue. I'm not sure what it means by "different Team IDs" though. However, when I debug the above post-export code, I'm finding that

    Directory.GetFiles($"{appPath}/Contents/PlugIns").Length


    returns 0 when it should return 1. If I open the built app file and view the contents, I can see that there is indeed a file there (the bundle I'm trying to sign). For some reason, this file is no longer being found during the post-export process.

    What I know:
    This code has worked previously. It has not changed, yet it no longer works on cloud builds. (builds fine locally)
    The bundle file is not there during the post-export step but is there in the final version of the app.
    Apple dev credentials are valid. The app itself is signed correctly. Specifically, the Chromium plugin bundle is not getting signed because it's not being found during the post-export signing process.
    Unity Editor 2022.1.18f1
    Ruby 2.4.2 and 2.7.4
    Unity Cloud Build
    Plastic repository

    Anyone got any ideas?
     
  2. ValeryNikulina

    ValeryNikulina

    Unity Technologies

    Joined:
    Oct 26, 2020
    Posts:
    138
    Hi,

    I'm afraid we'd need a closer look into your Cloud Build history, so could you please submit a support ticket is the issue is still present (I know it's been a while now)? Thanks!
     
  3. JonathanBartel

    JonathanBartel

    Joined:
    Jun 24, 2019
    Posts:
    45
    Danny Koh from Unity was able to help me resolve this issue. Apparently .bundle "files" are considered directories, not files. This makes sense, but Directory.GetFiles has worked for the past few years for me. This is no longer the case. Something changed somewhere along the way. Use Directory.GetDirectories to find .bundle "files".