One possible solution to resolve the duplicate classes error when including these dependencies in an Android project is to use the exclude command in the build.gradle file.
For example, you can exclude specific classes or packages from being included in the final build by adding the exclude command to the dependencies section of the file.
Here's an example of how to exclude the duplicate classes between sendbird-live-uikit and sendbird.sdk:uikit dependencies:
dependencies {
implementation ('com.sendbird.sdk:sendbird-live-uikit:1.0.10') {
exclude group: 'com.sendbird.sdk', module: 'sendbird-uikit'
}
implementation 'com.sendbird.sdk:sendbird-android-sdk:3.0.148'
implementation 'com.sendbird.sdk:sendbird-calls:1.1.10'
}
This code excludes the sendbird-uikit module from the com.sendbird.sdk:sendbird-live-uikit dependency, so it won't conflict with the sendbird.sdk:uikit dependency.
You can use a similar approach to exclude other modules or libraries that are causing duplicate classes errors.
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-07-04 06:03:25 +0000
Seen: 16 times
Last updated: Jul 04 '23
Can a transitive dependency in gradle be made exclusively for runtime purposes?
Why can't IntelliJ IDEA detect the Kotlin multiplatform library?
How do compileSdkVersion and targetSdkVersion differ from each other?
What does the error message "Failed to apply plugin [id 'com.jfrog.artifactory']" mean?
Why doesn't the Android Studio display the layout preview once MaterialCalendarView has been added?
How to update the outdated WebSecurityConfigurerAdapter in Spring Boot?
How can we add animation to the user interface using jetpack compose?