Livekit conflict and Error in Unity 6

What do you need help with?

Question

Installation method

UPM

Issue area

Package Manager / Dependencies

Impact

Major - a core flow is broken

Unity version

6.4

Convai Unity SDK version

4.4.1

Target platform

iOS

Where does it happen?

Sample scene

Short summary

Livekit conflict

What happened?

Livekit plugins conflict in uner Assets/Convai/… and Assets/Convai SDK for Unity/…
Even after I install the FFI libraries.
I was able to solve this a few times but when I close and reopen the project it happens again.

Unity Console errors or build logs

EntryPointNotFoundException: livekit_ffi_initialize assembly: type: member:(null)
LiveKit.Internal.FfiClient.InitializeSdk () (at Assets/Convai SDK For Unity/Plugins/client-sdk-unity-livekit/Runtime/Scripts/Internal/FFIClient.cs:236)
LiveKit.Internal.FfiClient.OnAfterAssemblyReload () (at Assets/Convai SDK For Unity/Plugins/client-sdk-unity-livekit/Runtime/Scripts/Internal/FFIClient.cs:109)
UnityEditor.AssemblyReloadEvents.OnAfterAssemblyReload () (at /Users/bokken/build/output/unity/unity/Editor/Mono/AssemblyReloadEvents.cs:43)

Screenshots, recording, logs, or minimal repro

I checked the relevant documentation, resources, and similar forum posts before posting.

on

I confirm that I did not include API keys, tokens, passwords, secrets, private character data, private conversation logs, or customer data.

on

Could you please remove the Assets\Convai\Plugins folder?

That does not help, unity recreats the Plugins everytime on runtime or after closing and reopenning the project.

This looks like duplicate copies of the LiveKit plugin ending up in the project, where only one copy carries the native FFI binary. Can you check the following and share the results?

  1. Search your whole project for all copies of the plugin folder:

    • Assets/Convai/Plugins/client-sdk-unity-livekit
    • Assets/Convai SDK for Unity/Plugins/client-sdk-unity-livekit (or similar)
    • Packages/com.convai.convai-sdk-for-unity/Plugins/client-sdk-unity-livekit
    • Library/PackageCache/com.convai.convai-sdk-for-unity@*/Plugins/client-sdk-unity-livekit
      How many copies exist, and under which exact paths?
  2. In each copy, does Runtime/Plugins/ffi-/ contain the native
    library (livekit_ffi.dll on Windows, .so/.dylib/.a on other platforms)?

  3. Did you install the Convai SDK both via a .unitypackage / manual Assets
    import AND via the UPM package (Package Manager / git URL)?

  4. Check the Console for a separate warning like “Multiple plugins with the
    same name ‘livekit_ffi’” around the time of the EntryPointNotFoundException
    — this confirms Unity is seeing more than one copy and picking the wrong one.

  5. Which Convai SDK install method did you use, and did you ever import an
    older version on top of a newer one without removing the old folder first?

Did you check?

Hello,
Sorry for the late reply. my quick fix was to build the App fro my iPhone regardless of the errors I would see on my macbook and it would work fine on the iPhone.

BUt I really want to also identify the issue on my computer in case I need the app on my macbook in the future.

SO regarding your questions, I only have livekits under:

  • Assets/Convai/Plugins/client-sdk-unity-livekit
  • Assets/Convai SDK for Unity/Plugins/client-sdk-unity-livekit (or similar)

Under the first patch I only have the livekits for ios and macos and under the second path I have Google, iOS ans system runtime as seen in the screenshot.

but I have also tried downloading FFI libraries for all platforms and current platform from the top convai menue. this only leads to more duplicates hence more errors.

I only installed the convai sdk via asset store and in my assets under package manager,

I never installed a newer version without removing the older one. I removed the current sdk multiple times and reimported it via package manager but everytime the error happens.

This is a typical Unity domain reload issue. You can resolve it using either of the following methods:

  1. Close Unity, delete the project’s Library folder, and reopen the project. Unity will reimport all assets.

  2. Enable Domain Reload:

    • Open Edit → Project Settings → Editor.

    • Find Enter Play Mode Settings.

    • Either disable Enter Play Mode Options entirely to restore the default Domain and Scene reload behavior, or keep it enabled and check Reload Domain.

    • Restart Unity once before entering Play Mode again.

I set that as Do not reload domain or scene, and even removed and reimported the convai sdk plugin but the same error pops up

Hi,

Please follow these steps to resolve the livekit_ffi loading error:

  1. In Unity’s Project window, navigate to:
    Assets → Convai → Plugins → client-sdk-unity-livekit → Runtime → Plugins

  2. Open ffi-macos-arm64 and select liblivekit_ffi.

  3. In the Inspector, confirm:

    • Editor is enabled.
    • Standalone is enabled.
    • OS is set to macOS.
    • CPU is set to Apple silicon.
    • Load on startup is enabled.
  4. Click Apply.

  5. Completely close the Unity Editor.

  6. Reopen the project and enter Play Mode.

Please refer to the attached screenshot for the highlighted settings.

This should resolve the DllNotFoundException: livekit_ffi error.

If you are using an Intel-based Mac, apply the same settings to the library inside ffi-macos-x86_64 and select the Intel/x86_64 CPU option instead.

I applied those changes and now get this error on run time:

[21:09:02.648][Error][SDK]: [AudioTrackManager] Character ‘76855a68-96e9-11f1-a8fa-42010a7be02f’ does not have an AudioSource assigned. Audio will NOT play!
UnityEngine.Debug:LogError (object)
Convai.Runtime.Logging.UnityConsoleSink:Write (Convai.Domain.Logging.LogEntry) (at Assets/Convai SDK For Unity/SDK/Runtime/Logging/UnityConsoleSink.cs:48)
Convai.Domain.Logging.LogSinkExtensions:WriteIfEnabled (Convai.Domain.Logging.ILogSink,Convai.Domain.Logging.LogEntry&) (at Assets/Convai SDK For Unity/SDK/Domain/Logging/ILogSink.cs:52)
Convai.Runtime.Logging.ConvaiLogger:DispatchToSinks (Convai.Domain.Logging.LogEntry&) (at Assets/Convai SDK For Unity/SDK/Runtime/Logging/ConvaiLogger.cs:264)
Convai.Runtime.Logging.ConvaiLogger:LogMessageUnchecked (string,Convai.Domain.Logging.LogLevel,Convai.Domain.Logging.LogCategory,System.Exception) (at Assets/Convai SDK For Unity/SDK/Runtime/Logging/ConvaiLogger.cs:198)
Convai.Runtime.Logging.ConvaiLogger:LogMessage (string,Convai.Domain.Logging.LogLevel,Convai.Domain.Logging.LogCategory,System.Exception) (at Assets/Convai SDK For Unity/SDK/Runtime/Logging/ConvaiLogger.cs:169)
Convai.Runtime.Logging.ConvaiLogger:Convai.Domain.Logging.ILogger.Error (string,Convai.Domain.Logging.LogCategory) (at Assets/Convai SDK For Unity/SDK/Runtime/Logging/ConvaiLogger.cs:543)
Convai.Domain.Logging.TaggedLogger:Error (string,Convai.Domain.Logging.LogCategory) (at Assets/Convai SDK For Unity/SDK/Domain/Logging/TaggedLogger.cs:61)
Convai.Runtime.Networking.Media.AudioTrackManager:HandleRemoteAudioTrackSubscribed (Convai.Infrastructure.Networking.IRemoteAudioTrack,string,string) (at Assets/Convai SDK For Unity/SDK/Runtime/Networking/Media/AudioTrackManager.cs:799)
Convai.Runtime.Adapters.Networking.RoomCharacterLifecycleCoordinator:HandleRemoteAudioTrackSubscribed (Convai.Infrastructure.Networking.IRemoteAudioTrack,string,string) (at Assets/Convai SDK For Unity/SDK/Runtime/Adapters/Networking/RoomCharacterLifecycleCoordinator.cs:107)
Convai.Runtime.Adapters.Networking.ConvaiRoomManager:HandleRemoteAudioTrackSubscribed (Convai.Infrastructure.Networking.IRemoteAudioTrack,string,string) (at Assets/Convai SDK For Unity/SDK/Runtime/Adapters/Networking/ConvaiRoomManager.Connection.cs:213)
Convai.Infrastructure.Networking.RemoteTrackSessionNotificationSupport/<>c__DisplayClass0_0:b__0 () (at Assets/Convai SDK For Unity/SDK/Runtime/Infrastructure/Networking/Abstractions/RemoteTrackSessionNotificationSupport.cs:31)
Convai.Infrastructure.Networking.RemoteTrackSessionNotificationSupport:DispatchInline (System.Action) (at Assets/Convai SDK For Unity/SDK/Runtime/Infrastructure/Networking/Abstractions/RemoteTrackSessionNotificationSupport.cs:93)
Convai.Infrastructure.Networking.RemoteTrackSessionNotificationSupport:Notify (System.Delegate,System.Action,string,string,Convai.Domain.Logging.ILogger,string,System.Func2<System.Action, bool>,Convai.Domain.Logging.LogCategory) (at Assets/Convai SDK For Unity/SDK/Runtime/Infrastructure/Networking/Abstractions/RemoteTrackSessionNotificationSupport.cs:72) Convai.Infrastructure.Networking.RemoteTrackSessionNotificationSupport:NotifyAudioTrackSubscribed (System.Action3<Convai.Infrastructure.Networking.IRemoteAudioTrack, string, string>,Convai.Infrastructure.Networking.IRemoteAudioTrack,string,string,Convai.Domain.Logging.ILogger,string,System.Func`2<System.Action, bool>,Convai.Domain.Logging.LogCategory) (at Assets/Convai SDK For Unity/SDK/Runtime/Infrastructure/Networking/Abstractions/RemoteTrackSessionNotificationSupport.cs:31)
Convai.Infrastructure.Networking.Native.NativeRoomController:HandleResolvedTransportAudioSubscription (Convai.Infrastructure.Networking.Transport.TrackInfo,Convai.Infrastructure.Networking.IRemoteParticipant,Convai.Infrastructure.Networking.IRemoteAudioTrack,bool,string) (at Assets/Convai SDK For Unity/SDK/Infrastructure/Networking/Native/NativeRoomController.cs:1030)
Convai.Infrastructure.Networking.Native.NativeRoomController:HandleRoomFacadeAudioTrackSubscribedCore (Convai.Infrastructure.Networking.IRemoteAudioTrack,Convai.Infrastructure.Networking.IRemoteParticipant) (at Assets/Convai SDK For Unity/SDK/Infrastructure/Networking/Native/NativeRoomController.cs:997)
Convai.Infrastructure.Networking.Native.NativeRoomController/NativeRoomEventBridge:HandleRoomFacadeAudioTrackSubscribed (Convai.Infrastructure.Networking.IRemoteAudioTrack,Convai.Infrastructure.Networking.IRemoteParticipant) (at Assets/Convai SDK For Unity/SDK/Infrastructure/Networking/Native/NativeRoomController.cs:1081)
Convai.Infrastructure.Networking.Native.NativeRoomFacade:RaiseFacadeTrackSubscribed (Convai.Infrastructure.Networking.IRemoteTrack,Convai.Infrastructure.Networking.Native.NativeRemoteParticipant,Convai.Infrastructure.Networking.TrackPublicationInfo) (at Assets/Convai SDK For Unity/SDK/Infrastructure/Networking/Native/NativeRoomFacade.cs:404)
Convai.Infrastructure.Networking.Native.NativeRoomFacade:OnTrackSubscribed (LiveKit.IRemoteTrack,LiveKit.RemoteTrackPublication,LiveKit.RemoteParticipant) (at Assets/Convai SDK For Unity/SDK/Infrastructure/Networking/Native/NativeRoomFacade.cs:285)
LiveKit.Room:OnEventReceived (LiveKit.Proto.RoomEvent) (at Assets/Convai SDK For Unity/Plugins/client-sdk-unity-livekit/Runtime/Scripts/Room.cs:411)
LiveKit.Internal.FfiClient:DispatchEvent (LiveKit.Proto.FfiEvent) (at Assets/Convai SDK For Unity/Plugins/client-sdk-unity-livekit/Runtime/Scripts/Internal/FFIClient.cs:504)
LiveKit.Internal.FfiClient/<>c:b__60_0 (object) (at Assets/Convai SDK For Unity/Plugins/client-sdk-unity-livekit/Runtime/Scripts/Internal/FFIClient.cs:481)
UnityEngine.UnitySynchronizationContext:ExecuteTasks () (at /Users/bokken/build/output/unity/unity/Runtime/Export/Scripting/UnitySynchronizationContext.cs:110)

Thanks for sharing the error. It indicates that the character’s remote audio track is being received, but the SDK cannot find an AudioSource registered for that character.

Could you please verify the following?

  • ConvaiCharacter, ConvaiAudioOutput, and AudioSource are enabled and attached to the same GameObject.
  • ConvaiAudioOutput is included in the character prefab itself, not only added to the scene instance.
  • The character GameObject or ConvaiAudioOutput component is not disabled and re-enabled before the audio track arrives.
  • With audio debug logging enabled, the message Registered AudioSource for character '76855a68-...' appears before the audio-track subscription message.

If ConvaiAudioOutput is missing, adding it to the character GameObject should resolve the issue. If it is already present and the object is being disabled and re-enabled at runtime, please let us know, as that may indicate an SDK lifecycle issue.

The Audio output component on the Convai Character was disabled. Enabling that solverd the issue.
Thanks!