Hello, I am trying to set up LiveKit for use in my...
# sdk-native
d
Hello, I am trying to set up LiveKit for use in my React Native app. I followed the tutorial on the site, but am still on Expo 52 rather than Expo 53. When I attempt to make an Android build, it generates many duplicate classes between two different versions of WebRTC, it seems.
Here's my app.config.js file, with some info stripped out to comply with my company's policies.
r
It sounds like you're encountering issues with duplicate classes due to conflicting versions of the WebRTC library while using Expo 52 with LiveKit. This is a common issue when dependencies are not aligned properly, especially with React Native and Expo. Here are some steps you can take to resolve this issue: 1. Upgrade Expo Since you're using Expo 52, consider upgrading to Expo 53 or later if possible. Newer versions often come with updated dependencies that may resolve conflicts. You can upgrade Expo by running:
Copy code
expo 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:
Copy code
cd android
./gradlew clean
Then, rebuild your project:
Copy code
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:
Copy code
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`:
Copy code
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