iOS build fails. XCODE, Ruby, Fastlane

EDIT To add template;
Unity version: 2020.2.7f1 (I’m aware this will become depreciated in July, but I would like to release this build without risking a major upgrade)
XCode version: 13.2.1 (I have it set to ‘use latest’)
Source control: GitHub
Local build platform: Windows 10
Build target: iOS

I’m getting Ruby/Fastlane errors when my project compiles with XCODE. I haven’t added any kind of Ruby to my project (I wouldn’t even know where to begin) and since this is project provisioning related I presume it has to do with the way the cloud build automates into XCODE in ways that are above my head.

Is this a known issue? Is there a workaround?

6026: + Building with Xcode 13.2.1
6027: ----------------------------------------
6028: — Step: Verifying fastlane version —
6029: ----------------------------------------
6030: Your fastlane version 2.182.0 matches the minimum requirement of 2.182.0 :white_check_mark:
6031: ------------------------------
6032: — Step: default_platform —
6033: ------------------------------
6034: Driving the lane ‘ios build’
6035: ----------------------------------
6036: — Step: set_info_plist_value —
6037: ----------------------------------
6038: -----------------------------------------
6039: — Step: update_project_provisioning —
6040: -----------------------------------------
6041: You’re updating provisioning profiles directly in your project, but have you considered easier ways to do code signing?
6042: https://docs.fastlane.tools/codesigning/GettingStarted/
6043: Parsing mobile provisioning profile from ‘/BUILD_PATH/Library/MobileDevice/Provisioning Profiles/5ef6edf1-6daf-4585-ae19-d920ae736fd1.mobileprovision’
6044: Going to update project ‘Unity-iPhone.xcodeproj’ with UUID
6045: Updating target Unity-iPhone…
6046: Updating configuration Release…
6047: ±-----------------±----------+
6048: | Lane Context |
6049: ±-----------------±----------+
6050: | DEFAULT_PLATFORM | ios |
6051: | PLATFORM_NAME | ios |
6052: | LANE_NAME | ios build |
6053: ±-----------------±----------+
6054: ±-----±----------------------------±------------+
6055: | fastlane summary |
6056: ±-----±----------------------------±------------+
6057: | Step | Action | Time (in s) |
6058: ±-----±----------------------------±------------+
6059: | 1 | Verifying fastlane version | 0 |
6060: | 2 | default_platform | 0 |
6061: | 3 | set_info_plist_value | 0 |
6062: | | update_project_provisioning | 0 |
6063: ±-----±----------------------------±------------+
6064: fastlane finished with errors
6065: /BUILD_PATH/.rvm/gems/ruby-2.4.2/gems/fastlane-2.182.0/fastlane/lib/fastlane/actions/update_project_provisioning.rb:73:in block (2 levels) in run': [!] undefined method [ ]’ for nil:NilClass (NoMethodError)

I found this;
https://github.com/fastlane/fastlane/issues/20172

(Basically delete and recreate the provisioning profile)

I don’t have the time to try this right now, will try it later.

Did you find any solution to this issue?

It looks like the fastlane/certs issue from a month or so ago. Go to your apple developer page, create a new provisioning profile for your app. Download it. Go to the UCB dashboard for credentials. Update (or edit? I don’t remember the exact name), and replace the provisioning profile with the one you downloaded. Do a clean build, and it should be working again