android(call): fix LiveKit audio API import + audioswitch duplicate-class

JitPack fix worked; two new failures surfaced, both fixed here:

1) checkDebugDuplicateClasses: LiveKit 2.29.2 already BUNDLES a fork
   (com.github.davidliu:audioswitch) carrying the same com.twilio.audioswitch
   classes at runtime, so our explicit `implementation com.twilio:audioswitch`
   put both on the runtime classpath. Switch it to `compileOnly` — we get the
   AudioDevice types at compile time, runtime uses only LiveKit's bundled fork.
   (Also clears the "namespace used in multiple modules" merge warning.)

2) CallMedia.kt: `Unresolved reference: AudioOptions`. In 2.29.2 AudioOptions
   is declared in package io.livekit.android (inside LiveKitOverrides.kt), not
   io.livekit.android.audio. Corrected the import. Verified AudioSwitchHandler's
   API (registerAudioDeviceChangeListener / availableAudioDevices /
   selectedAudioDevice / selectDevice) against the v2.29.2 source.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
SravanandClaude Opus 4.8 committed 2026-10-30 20:42:00 +05:30
1 parent 7cd3c3afff
commit ea4d65274e
2 files changed
+7 -3

No files matched your search

@@ -5,7 +5,7 @@ import android.util.Log
import com.twilio.audioswitch.AudioDevice
import io.livekit.android.LiveKit
import io.livekit.android.LiveKitOverrides
import io.livekit.android.audio.AudioOptions
import io.livekit.android.AudioOptions
import io.livekit.android.audio.AudioSwitchHandler
import io.livekit.android.room.Room
import kotlinx.coroutines.CoroutineScope