Skip to content

Scope precompiled DLLs to LiveKit asmdef to avoid clashes#270

Merged
MaxHeimbrock merged 1 commit into
mainfrom
max/fix-protobuf-clash
May 5, 2026
Merged

Scope precompiled DLLs to LiveKit asmdef to avoid clashes#270
MaxHeimbrock merged 1 commit into
mainfrom
max/fix-protobuf-clash

Conversation

@MaxHeimbrock
Copy link
Copy Markdown
Contributor

@MaxHeimbrock MaxHeimbrock commented May 4, 2026

Summary

  • Mark Google.Protobuf.dll and System.Runtime.CompilerServices.Unsafe.dll as isExplicitlyReferenced: 1
  • Switch livekit.unity.Runtime.asmdef to overrideReferences: true and explicitly list our precompiled deps (Google.Protobuf.dll, System.Runtime.CompilerServices.Unsafe.dll, Newtonsoft.Json.dll)
  • Result: our bundled DLL versions are scoped to the LiveKit assembly only, so other packages bundling their own copies (e.g. com.unity.ai.assistant) no longer trigger Unity's "Duplicate assembly with different versions detected" CS0246/CS0538 cascade

Background

With com.unity.ai.assistant (which ships Google.Protobuf 3.33.2 and System.Runtime.CompilerServices.Unsafe 6.0.3) installed in a project, Unity's duplicate-assembly detection picked the AI Assistant's newer DLLs over ours, but their copies are isExplicitlyReferenced: 1 and editor-only — so they didn't auto-reference into the LiveKit assembly either. Result: LiveKit ended up with no Google.Protobuf reference at all, breaking Runtime/Scripts/Proto/*.cs.

Marking our DLLs as explicitly-referenced and binding them to the LiveKit asmdef via overrideReferences + precompiledReferences keeps our copies scoped to LiveKit's compilation unit and out of the project-wide auto-reference pool, so the duplicate detection no longer affects us.

🤖 Generated with Claude Code

Mark Google.Protobuf and System.Runtime.CompilerServices.Unsafe as
isExplicitlyReferenced and switch the LiveKit asmdef to overrideReferences
with explicit precompiledReferences. This isolates our DLL versions to the
LiveKit assembly so other packages bundling their own copies (e.g.
com.unity.ai.assistant) no longer clash via Unity's duplicate-assembly
detection.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@MaxHeimbrock MaxHeimbrock merged commit 6d78387 into main May 5, 2026
15 checks passed
@MaxHeimbrock MaxHeimbrock deleted the max/fix-protobuf-clash branch May 5, 2026 06:59
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.

1 participant