0

I'm new to Gradle and Android so please explain as much as possible so I can learn.

I do understand that the .jar contains an old version and it is conflicting with the new com.android.support:design:28.0.0 version which I need to use Snackbar. I'm hoping there's a way to fix this easily in Gradle. I've done some research but I'm confused on the use of resolutionStrategy.force and the new Androidx and a few other things.

The image provided pretty much sums it up.

There is a long list of Duplicate class warnings. This is just a sample.

Duplicate class

android.support.v4.accessibilityservice.AccessibilityServiceInfoCompat found in modules classes.jar (com.android.support:support-compat:28.0.0) and classes.jar (com.android.support:support-v4:24.0.0)
Duplicate class android.support.v4.app.ActionBarDrawerToggle found in modules classes.jar (com.android.support:support-core-ui:28.0.0) and classes.jar (com.android.support:support-v4:24.0.0)

Project, app gradle and build warnings

Anggrayudi H
  • 14,977
  • 11
  • 54
  • 87
  • you can exclude the duplicate classes – Manoj Perumarath Nov 21 '19 at 05:49
  • 1
    Just use Androidx library now you wont get such issues. Support library is no more maintained. So better go for new Jetpack libraries in android if you're new to android. [refer this SO post](https://stackoverflow.com/a/52517772/5466486). But if you're stuck in a project with old architecture then do exclude the old classes by using exclude in the dependency where you're getting the issue, for e.g. `implementation ('org.apache.httpcomponents:httpmime:4.3.6') { exclude module: 'httpclient' }` – Sanket Patel Nov 21 '19 at 06:01
  • Thanks Sanket for providing an example. I think that would work. I am stuck with the old architecture since it is generated in a game dev tool. I would have to exclude a lot of modules. For now I found another work around by using the old widget toast. – Kroanos M Nov 22 '19 at 06:43

0 Answers0