ibrahimsn98 / SmoothBottomBar

A lightweight Android material bottom navigation bar library
MIT License
1.95k stars 253 forks source link

Dependencies conflict between appcompat 1.5.1 and SmoothBottomBar 1.7.9 #107

Closed henrichg closed 1 year ago

henrichg commented 2 years ago

Not possible to compile my application, when is used appcompat 1.5.1.

"Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.2.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)"

By depencdecies graph generated with "gradle app:dependencies" problem is with your library. Only this library uses androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0 in my application.

Look at: https://issuetracker.google.com/issues/242384116 @jb...@google.com write me: "That's your app having inconsistent dependencies now, not AppCompat. Lifecycle is a library group so you should not be mixing different versions together in your app.

You could find out which dependency is giving you the older version and update that to see it helps, or you can go the easier route and just add an explicit dependency on androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1 in your main module. Lifecycle was partially convert to Kotlin since 2.4 so trying to mix older versions will cause conflicts.

We have been looking at adding constraints as part of Lifecycle 2.6 to help out here, but for right now you need to resolve them directly in your app."

Plesae fix this, by using androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1.

Thank you.

henrichg commented 1 year ago

AppCompat 1.6.0 solve this problem.