Skip to content

Fix iOS build on Unity 6.5#360

Merged
MaxHeimbrock merged 4 commits into
mainfrom
max/meet-ios-postbuild-nullguard
Jul 27, 2026
Merged

Fix iOS build on Unity 6.5#360
MaxHeimbrock merged 4 commits into
mainfrom
max/meet-ios-postbuild-nullguard

Conversation

@MaxHeimbrock

@MaxHeimbrock MaxHeimbrock commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Background

This fixes #359

Unity 6000.5 re-architected the iOS export: the engine library is no longer
Libraries/libiPhone-lib.a but a static Frameworks/UnityRuntime.framework
(which still bundles the old CELT/libvpx objects that conflict with the opus/vpx
inside liblivekit_ffi.a). Our iOS post-build protection was hardwired to
libiPhone-lib.a, so on 6000.5 it silently no-oped and apps crashed at runtime
in ec_tell_frac (confirmed on device with the Meet sample).

On top of that, the Meet and Agents samples' own BuildPostProcessor passed the
now-null file GUID for libiPhone-lib.a into RemoveFileFromBuild, failing every
iOS build on 6000.5 with an ArgumentNullException.

The exported frameworks build phase is also no longer labeled /* UnityFramework */;
build logs show that marker didn't even match on 6000.3, so the link-order rewrite
was already a no-op there and only the CELT strip was protecting older builds.

Changes

  • IosLinkOrderDiagnostics now resolves the engine library per export layout:
    Libraries/libiPhone-lib.a (up to 6000.4) or Frameworks/UnityRuntime.framework
    (6000.5+). Reorder, CELT strip, and the diagnostic all operate on the resolved
    library; behavior on the old layout is unchanged.
  • Locate the UnityFramework frameworks build phase by content (the phase linking
    liblivekit_ffi.a) instead of the /* UnityFramework */ label, which also
    repairs the reorder/diagnostic on pre-6.5 exports.
  • Meet & Agents samples: guard the libiPhone-lib.a remove/re-add so iOS builds
    no longer fail on 6000.5.
  • README: document both export layouts.

Verified on Unity 6000.5.5f1 (device): export logs show the link-order fix applied,
18 conflicting CELT objects stripped from UnityRuntime, diagnostic OK, and the
Meet app no longer crashes.

MaxHeimbrock and others added 4 commits July 24, 2026 14:39
…ork export

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxHeimbrock MaxHeimbrock changed the title iOS postbuild nullguard Fix iOS build on Unity 6.5 Jul 24, 2026

@xianshijing-lk xianshijing-lk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm in general, one question

Debug.LogWarning(
$"{Prefix}: iOS link-order diagnostic found a risky order in UnityFramework -> Frameworks and Libraries. " +
"libiPhone-lib.a appears before liblivekit_ffi.a. This repo documents that this can crash Opus/CELT on iOS. " +
$"{engineName} appears before liblivekit_ffi.a. This repo documents that this can crash Opus/CELT on iOS. " +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we have script to auto fix the problem and make sure we load liblivekit_ffi.a before libiPhone-lib.a ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the script works until Unity 6.4, but in 6.5 Unity apparently changed their lib composition and naming.

A customer reported the crash: #359
They also already confirmed the fix works for them as well. I will now test if it still works in Unity 2022 or Unity 6.3, but that behaviour should still be intact.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed the old way of building is not touched in lower Unity versions.

@xianshijing-lk xianshijing-lk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, I just missed the BuildPostProcessor.cs. Please ignore my previous comment

@MaxHeimbrock
MaxHeimbrock marked this pull request as ready for review July 27, 2026 08:37
@MaxHeimbrock
MaxHeimbrock merged commit 963a518 into main Jul 27, 2026
11 checks passed
@MaxHeimbrock
MaxHeimbrock deleted the max/meet-ios-postbuild-nullguard branch July 27, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS Unity 6 crash in ec_tell_frac: IosLinkOrderDiagnostics does not handle libGameAssembly.a

2 participants