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

Codesign Failed with Exit Code 1 - MacOS

Discussion in 'macOS' started by zenasprime, Jan 23, 2021.

  1. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64

    Sorry for late reply.

    I've again tested with the new IAP version that came out few days ago (3.0.1) in empty project Unity 2020.3.0f1. First I've tested only with IAP included but not the script.. the test went through without issues.

    Then I've tested with the demo scene that Unity includes along with the IAP. I've ran the build and the project crashed on start.

    I've submitted bug report.
     
  2. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    It's been quite a while since this topic was started and there still doesn't seem to be any solution. Luckily I have been able to postpone the MacOS release up until this point. I am now moving towards getting a MacOS build ready but only stumbling block to continuing development is now an inability to build to MacOS while needing to include Unity Purchasing. Is there any way we can expedite this bug fix?
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    Do you have a bug report #? I haven't seen anything related coming in (it could still be with QA trying to reproduce it, though).
     
  4. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    I have not. No real time to dig into it much more than I currently have. Ideally I'd like to hit the build button, test on the MacOS device, then archive and upload to the Apple Connect so I can start doing some testing through Test Flight.

    It does look like l2Play submitted a bug report. Maybe they can give you a report #.
     
  5. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64
    Not sure what bug we are now talking about, but I've submitted a bug for the earlier mentioned "crash on startup with IAP" bug. The team got back to me, saying they couldn't reproduce the issue with an Empty project and included IAP. I've then sent a project and a video process, showing how to reproduce the issue. No response so far.
     
    zenasprime likes this.
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    Thanks, I'll follow up with QA to see where we're at.
     
    In2Play and zenasprime like this.
  7. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64
    Please do. It was quite a while since I've sent a video and a project and no response so far.
     
  8. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64
  9. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    Will do.

    This has been an issue for me for over a year now that think about it. I was having a similar issue with building to MacOS for another game about a year ago but I just gave up after not finding a solution. It seems that this is something that can only be fixed on Unity's end. And yes, until then, we just can't build to MacOS with IAP.

    For the game I have currently in development I purpose decided not to pursue IAP simply because of this headache. Hopefully it gets fixed ASAP.
     
  10. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64
    Thank you for voting on the issue. To me I'm baffled by the fact that no one has noticed this issue for such a long time. I've successfully submitted the same project on iOS and tvOS stores but couldn't on macOS Store. I thought it was an issue on my end, but then I was able to reproduce the issue with Unity's own IAP package and completely empty project.

    Anyway, they are aware of the issue, and hopefully, it will get fixed soon.
     
    MrQube likes this.
  11. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    Well to be fair, few developers are probably independently implementing IAP for MacOS. Though I do have to say that it's not the only issue I've found with Unity Purchasing. I'm not sure if you noticed this on your builds to Xcode, but I have to manually assign both the IAP (and Game Center for that matter) capabilities in Xcode, as well as the StoreKit framework for tvOS. And have to do so with every build I make (it get's wiped even when I append). It took me a bit of time to figure that out as well, all without any online references to fall back on. Just reading the debugger output and making some educated guesses.

    I am also doing the Apple trifecta of iOS, tvOS, and MacOS with the same Apps, mostly inspired by Apple Arcade and the "buy for one platform, own it on all" paradigm that Apple is pushing for. It make sense for games that can easily be adapted for each platform. It's is (or rather should have been) just a matter of switching platforms and building.
     
    MrQube likes this.
  12. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64
    " I'm not sure if you noticed this on your builds to Xcode, but I have to manually assign both the IAP (and Game Center for that matter) capabilities in Xcode,"

    Yep, I've noticed. But since it's "solvable" it doesn't represent a big issue for me. However, it's annoying because when it doesn't work you need to spend a lot of time figuring out the trivial things. I can't tell how many weeks I've spent (yeah weeks altogether), just because of the IAP problems, mostly within the UnityEditor (dll files not found etc). I do a lot of switching between projects and this is a total nightmare for me. It never "just works" out of the box. Hopefully, 3.0.1 update solved Editor issues (fingers crossed).

    "I am also doing the Apple trifecta of iOS, tvOS, and MacOS with the same Apps, mostly inspired by Apple Arcade and the "buy for one platform, own it on all" paradigm that Apple is pushing for. It make sense for games that can easily be adapted for each platform. It's is (or rather should have been) just a matter of switching platforms and building."

    I saw your game listing on the iOS and tvOS store. Looks amazing - Good job :)
     
    zenasprime likes this.
  13. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    Thanks. :D

    Hopefully I can get a version up on the MacOS store soon too. ;)
     
  14. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    Any progress on this issue?

    Just a reminder that it's currently impossible to build for MacOS while using Unity IAP.
     
    In2Play likes this.
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    It's under investigation by one of the IAP developers. So far it looks like the issue might be related to incorrect threading.
     
    In2Play likes this.
  16. MrQube

    MrQube

    Joined:
    Sep 1, 2019
    Posts:
    6
    Sorry for hijacking this, but I am currently running against a similar wall … without IAP, though! I just wonder: did you ever get a project built with catalyst support at all? And if so, have you been encountering anything like this:

    https://forum.unity.com/threads/add...eates-100-errors-with-unityframework.1090324/
     
  17. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    I believe that these are separate issues. Sorry.
     
  18. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    Hello!
    I am currently looking at this issue.
    If you build in Xcode and then run the app by just double clicking on it, does it run fine? That's what I'm seeing on my end.
     
  19. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    No, it crashes.

    Edit:

    Sorry, if you build in Unity it crashes. The build fails if you attempt to build in Xcode. There's where the Code Sign Error is presented.

    Code (CSharp):
    1. CodeSign /Users/zbellace/Library/Developer/Xcode/DerivedData/FishHeadsMacOS-eyjfovgwznmfmgbyehwirmxjbgxt/Build/Products/Debug/Fish\ Heads.app
    2.     cd "/Volumes/Aux/Development/Unity/QuadraTron Games/Production/infiniterunnersummer2020/Builds/FishHeads-MacOS"
    3.     export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
    4.  
    5. Signing Identity:     "Apple Development: zenas Bellace (W59TT8LXY9)"
    6. Provisioning Profile: "Mac Team Provisioning Profile: com.quadratron.fishheads"
    7.                       (xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx)
    8.  
    9.     /usr/bin/codesign --force --sign EDA538D8BA06C9BA7DCB0C8649A4E393D81CF1C8 --entitlements /Users/zbellace/Library/Developer/Xcode/DerivedData/FishHeadsMacOS-eyjfovgwznmfmgbyehwirmxjbgxt/Build/Intermediates.noindex/FishHeadsMacOS.build/Debug/Fish\ Heads.build/Fish\ Heads.app.xcent --timestamp=none /Users/zbellace/Library/Developer/Xcode/DerivedData/FishHeadsMacOS-eyjfovgwznmfmgbyehwirmxjbgxt/Build/Products/Debug/Fish\ Heads.app
    10.  
    11. /Users/zbellace/Library/Developer/Xcode/DerivedData/FishHeadsMacOS-eyjfovgwznmfmgbyehwirmxjbgxt/Build/Products/Debug/Fish Heads.app: code object is not signed at all
    12. In subcomponent: /Users/zbellace/Library/Developer/Xcode/DerivedData/FishHeadsMacOS-eyjfovgwznmfmgbyehwirmxjbgxt/Build/Products/Debug/Fish Heads.app/Contents/PlugIns/unitypurchasing.bundle
    13. Command /usr/bin/codesign failed with exit code 1
     
  20. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    This looks different than the bug I have. I will investigate signing with a real provisioning profile and entitlements.

    Any chance you could send in a minimal repro project?
     
  21. MrQube

    MrQube

    Joined:
    Sep 1, 2019
    Posts:
    6
    You are right.

    Still I managed to solve my problem simply by removing the whitespace from the project name, and as you have one in your project name, too (Fish Heads), maybe it will be your solution as well (FishHeads).

    Best, Jens
     
    zenasprime likes this.
  22. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    I believe ln2Play already did that above...

     
  23. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    The bug that In2Play submitted turned out to be a different bug.

    Did you try building with no spaces in the product name? I'm investigating that right now.
     
  24. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    How do you know and what was the solution?
     
  25. In2Play

    In2Play

    Joined:
    Apr 25, 2016
    Posts:
    64
    @zenasprime

    There are two different bugs. One is the codesigning issue that I was facing too. I've solved it by upgrading the IAP to 3.0.1. However codesigning issue on macOS is present in all IAP Unity plugins earlier than 3.0.

    Another bug is crash on start that you were facing too.. and that was the bug that I submitted since it couldn't get around it. I assume that Pixel JJ worked on that particular bug and he found a workaround - instead of letting the XCode run the project automatically when done building, you run the binary directly. This won't cause a crash.

    Once I test my in app purchases and submit the file to the Apple I will post a feedback.
     
    PixelJ likes this.
  26. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    @In2Play

    Thanks for the update. I updated to Unity Purchasing 3.1.0 and I can build and run the app now. You are, however, correct, I can't run it from Xcode, but it does run if I run the .app file directly OR from Unity.

    I'm assuming that I should be able to push this to Apple Connect. I still have some porting to do for the MacOS build so it will be a few weeks before I can give that a try.

    Let me know how it goes for you.
     
    In2Play likes this.
  27. PixelJ

    PixelJ

    Unity Technologies

    Joined:
    Nov 1, 2018
    Posts:
    216
    MONO_DEBUG=explicit-null-checks /Applications/Xcode.app/Contents/MacOS/Xcode

    This will keep it from crashing when debugging with Xcode.
     
  28. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,504
    To clarify this, the reason this is needed because the "crash" is actually caused by a null reference exception in the project. Xcode/LLDB gets confused and thinks it's a crash where in reality Mono would catch it if running without a debugger attached.
     
    zenasprime likes this.
  29. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165
    I just wanted to circle back and say that 2019.4.17f1 and In App Purchasing 3.1.0 now seems to be building and executing with Xcode. It's been a long trip but thank you. I'll circle back again if something odd starts happening again.

    Cheers!
     
    In2Play likes this.
  30. zenasprime

    zenasprime

    Joined:
    Mar 31, 2010
    Posts:
    165