damp-caravan-86892
08/18/2025, 2:09 PMdamp-caravan-86892
08/18/2025, 2:15 PMrefined-appointment-81829
08/18/2025, 2:16 PMexpo upgrade
2. Check Dependencies
Make sure that your package.json does not have conflicting versions of WebRTC or other dependencies. You can check the versions of your dependencies and ensure that they are compatible with each other.
3. Clean Build
Sometimes, a clean build can help resolve issues with duplicate classes. You can try the following commands:
cd android
./gradlew clean
Then, rebuild your project:
cd ..
expo run:android
4. Exclude Duplicate Classes
If upgrading is not an option, you can manually exclude the conflicting WebRTC classes in your android/app/build.gradle file. You can add the following lines to exclude the specific WebRTC dependencies that are causing conflicts:
configurations {
all {
exclude group: 'org.webrtc', module: 'google_webrtc'
}
}
5. Use the LiveKit Expo Plugin
If you haven't already, consider using the LiveKit Expo plugin, which may help manage dependencies better. You can install it by following the instructions in the LiveKit Expo Plugin README.
Example Configuration
Here’s an example of how you might configure your `android/app/build.gradle`:
dependencies {
implementation project(':livekit_react_native')
implementation project(':livekit_react_native_webrtc')
// Exclude conflicting WebRTC classes
configurations {
all {
exclude group: 'org.webrtc', module: 'google_webrtc'
}
}
}
Conclusion
By following these steps, you should be able to resolve the duplicate class issue you're facing. If the problem persists, consider checking the LiveKit documentation for any specific compatibility notes regarding Expo versions.
References
• livekit/client-sdk-react-native/README.md#L111-L201
• livekit/client-sdk-react-native/README.md#L111-L201
• livekit/client-sdk-react-native-expo-plugin/README.md#L33-L53
• livekit/client-sdk-react-native-expo-plugin/README.md#L33-L53