NPC Connection error on iOS

is that updated because that is how I installed it, I don’t want to break anything that has been working before, Is there a version I should be using in the version section?

It won’t break anything, so how can we provide a fix? Please make sure you are using version 4.1.0 and managing your project with GitHub or another version control system.

OK I am using unity version control

Already, you can’t edit the Convai Asset when using the UPM version, so it shouldn’t be an issue.

[Package Manager Window] Error adding/removing packages: com.convai.convai-sdk-for-unity@4.1.0.
Unable to add packages:
Unable to add package [com.convai.convai-sdk-for-unity@4.1.0]:
Package [com.convai.convai-sdk-for-unity] is already embedded and cannot be updated, it must first be manually removed from the Packages folder of the project.
0x00007fffa01020ae (Unity) StackWalker::ShowCallstack
0x00007fffa1937479 (Unity) PlatformStacktrace::GetStacktrace
0x00007fffa1937cfe (Unity) Stacktrace::GetStacktrace
0x00007fffa00b2b0f (Unity) DebugStringToFile
0x00007fff9ff6d600 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x000001fd0f8c5dad (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log_Injected (UnityEngine.LogType,UnityEngine.LogOption,UnityEngine.Bindings.ManagedSpanWrapper&,intptr)
0x000001fd0f8c5c73 (Mono JIT Code) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000001fd0f8c58ab (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object)
0x000001fd0f8c5630 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000001fe540123a5 (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000001fe5401120b (Mono JIT Code) UnityEditor.PackageManager.UI.Internal.UpmBaseOperation1<T_REF>:OnError (UnityEditor.PackageManager.UI.Internal.UIError) 0x000001fe04e19b03 (Mono JIT Code) UnityEditor.PackageManager.UI.Internal.UpmBaseOperation1<T_REF>:Progress ()
0x000001fe03cec200 (Mono JIT Code) UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()
0x000001fec9705945 (Mono JIT Code) (wrapper runtime-invoke) object:runtime_invoke_void (object,intptr,intptr,intptr)
0x00007fff969e6c0e (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007fff96928984 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3068)
0x00007fff96928a70 (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3115)
0x00007fffa0939e34 (Unity) scripting_method_invoke
0x00007fffa0940cf3 (Unity) ScriptingInvocation::Invoke
0x00007fffa093c295 (Unity) ScriptingInvocation::Invoke
0x00007fffa0f274bb (Unity) Scripting::UnityEditor::EditorApplicationProxy::Internal_CallUpdateFunctions
0x00007fffa15a38c7 (Unity) SceneTracker::Update
0x00007fffa117320d (Unity) Application::TickTimer
0x00007fffa0f5588c (Unity) MainMessageLoop
0x00007fffa0f5d322 (Unity) UnityMain
0x00007ff7bce32f2a (Unity) __scrt_common_main_seh
0x00007ff8a662e8d7 (KERNEL32) BaseThreadInitThunk
0x00007ff8a70cc3fc (ntdll) RtlUserThreadStart

You don’t need to write a version

I don’t understand what you mean

Delete the 4.1.0 text. You don’t need to specify a version.

ok stand by

image

OK I will manually remove the package

then remove and install again.

OK I re-installed worked through all the errors for a clear console tested in unnity and everything worked as expected, did the unity cloud and uploaded to the appstore everything ran as expected loaded on my device using testflight and whe I click on the npc I get a connection error

What do you mean by “when I click on the NPC”? Did you implement any custom logic there? It should initialize automatically when the scene starts. Could you please share the logs? It’s working as expected on our side.

OK when I say click I have a character selection screen that you would click on to switch between npcs that then call a new scene when I enter that scene that is where i encounter the connection error, in another post you told me I could not have more than 1 NPC per scene which is why I built it like that, Here is the iPhone Log that I have,

10042026_142511_453_iPhone.log (220.2 KB)

my character selection screen

Any ideas or suggestions?

For now, could you please just build our basic sample?

I have done that already and it worked, I am not sure how building the sample scene helps my project?

Brief Analysis for Convai Developers (starting from SDK 4.1.0 upgrade only)

After upgrading to Convai SDK 4.1.0, two problems appeared on iOS:

  1. Cloud Build failures
    The builds failed with “Scripts have compiler errors”.
    Cause: IL2CPP code stripping removed critical networking, gRPC, and JSON deserialization classes needed by the new SDK version.
    Fix: Added a comprehensive link.xml file that preserves:

    • All Convai assemblies

    • LiveKit and gRPC assemblies

    • Newtonsoft.Json, Google.Protobuf, and related system libraries

    • Specific message payload types (BotTranscriptionPayload, BotLLMTextPayload, etc.)

    This restored successful builds.

  2. Runtime connection error
    Even after successful builds, the app showed an immediate “connection error” when selecting any NPC.
    Cause: The native AVAudioSession setup was conflicting with LiveKit’s requirements on iOS.
    Fix: Updated the native audio configuration in the iOS stub file (ConvaiAudioStub.mm):

    • Added AVAudioSessionCategoryOptionMixWithOthers

    • Changed activation to use AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation

These two changes (the strong link.xml + corrected native audio session) fully resolved both the build failures and the runtime connection error introduced by the 4.1.0 upgrade.

The app now launches and connects to NPCs correctly on iOS.

I was checking a different message, sorry. Glad to hear everything is working.