0

I have a jar file in libs which uses android.support.v4 and I'm trying to migrate to AndroidX. Now, Gradle sync fails until I setandroid.enableJetifier=false . But if I set this flag to false then I get D8 error

Program type already present: android.support.v4.media.MediaBrowserCompatApi21$MediaItem

What's the right way to solve this migration issue ?

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
Nayanesh Gupte
  • 2,735
  • 25
  • 37
  • This cannot be answered unless you'd provide the `dependencies`, which would permit to determine where module `support-v4` needs to be excluded. And this is with high probability not a migration issue, when duplicate support-library classes exist in the package. – Martin Zeitler Oct 05 '19 at 00:39
  • Besides, `exclude` works for `*.jar` just alike it works for any other dependency. – Martin Zeitler Oct 05 '19 at 00:50
  • Check whether the library whose jar you are using has started using androidX. If yes, then you can replace it with a new jar. – Prashast Oct 06 '19 at 17:08

0 Answers0