Skip to main content

Integration Issues

Problem: Errors occur when installing SDK using Gradle.Solutions:
  1. Check if Gradle version meets requirements (7.0+)
  2. Clean cache and reinstall:
    ./gradlew clean
    ./gradlew build --refresh-dependencies
    
  3. Check network connection and repository configuration
  4. Ensure you have the correct repository in your build.gradle:
    repositories {
        mavenCentral()
        // or your custom repository
    }
    
Prevention:
  • Use the latest stable Gradle version
  • Regularly update dependencies
  • Use the same Gradle version in CI/CD

Runtime Issues

Problem: Avatar file loading fails, showing error messages.Possible causes:
  1. Network connection issues
  2. Incorrect avatar ID
  3. Avatar resource format not supported
  4. Cache corruption
Troubleshooting steps:
  1. Check network connection status
  2. Verify avatar ID is valid
  3. Check Logcat for error messages
  4. Clear cache and retry:
    lifecycleScope.launch {
        AvatarManager.clear("avatar-id")
        // Retry loading
    }
    
Solution:
try {
    val avatar = AvatarManager.load("avatar-id") { progress ->
        when (progress) {
            is AvatarManager.LoadProgress.Failed -> {
                Log.e(TAG, "Load failed: ${progress.error.message}")
            }
            else -> { /* handle other states */ }
        }
    }
} catch (e: Exception) {
    Log.e(TAG, "Failed to load avatar: ${e.message}", e)
}
Problem: WebSocket connection cannot be established.Solutions:
  1. Check network connection
  2. Confirm sessionToken is set correctly
  3. Check firewall and security settings
  4. View Logcat error messages
avatarView.avatarController.onConnectionState = { state ->
    when (state) {
        is AvatarController.ConnectionState.Failed -> {
            Log.e(TAG, "Connection failed: ${state.exception.message}")
            // Implement retry logic
        }
        else -> { /* handle other states */ }
    }
}

Feature Questions

Solution: Only 16-bit mono PCM data is supported at the moment.
// Audio data example
val audioData = readAudioFile() // Your audio reading logic
avatarView.avatarController.send(audioData, end = false)

// When audio ends, must call with end=true
avatarView.avatarController.send(audioData, end = true)
Solution: Use AvatarManager cache management APIs.
// Get cache statistics
lifecycleScope.launch {
    val stats = AvatarManager.getCacheStats()
    Log.d(TAG, "Cache: ${stats.totalEntries} entries, ${stats.totalSizeMB}MB")
}

// Clear specific avatar cache
lifecycleScope.launch {
    AvatarManager.clear("avatar-id")
}

// Clear all cache
lifecycleScope.launch {
    AvatarManager.clearAll()
}