Unity/バージョンアップメモ/unity2022.3.11f1
提供: 初心者エンジニアの簡易メモ
Assertion failedエラー
エラー詳細
Assertion failed: (false && "compact unwind compressed function offset doesn't fit in 24 bits"), function operator(), file Layout.cpp, line 5758.
対策
- xcodeのBuildSettingで、PROJECT側のUnity-iPhoneの"Other Linker Flag"に"-ld_classic"を追加。
参考:https://developer.apple.com/forums/thread/735426
PostProcess対応
Assets/Editor/XcodeIdClassicPostProcess.cs
using UnityEditor; using UnityEditor.Callbacks; using UnityEditor.iOS.Xcode; public static class XcodeIdClassicPostProcess { [PostProcessBuild] public static void OnPostProcessBuild(BuildTarget target, string path) { if (target != BuildTarget.iOS) { return; } var project = new PBXProject(); project.ReadFromFile(PBXProject.GetPBXProjectPath(path)); project.AddBuildProperty(project.GetUnityMainTargetGuid(), "OTHER_LDFLAGS", "-ld_classic"); // project.SetBuildProperty(project.GetUnityFrameworkTargetGuid(), "OTHER_LDFLAGS", "-ld_classic"); project.WriteToFile(PBXProject.GetPBXProjectPath(path)); } }