eltos / SimpleDialogFragments

An Android library to create dialogs with ease and handle user interaction reliably, using fragments and material design.
Apache License 2.0
119 stars 17 forks source link

Dependency problem #82

Closed isabsent closed 1 year ago

isabsent commented 1 year ago

Last release which is compiled normally is 3.5

3.5.2 gives:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:armeabi_v7aDebugRuntimeClasspath'.

3.6 and 3.6.4 give:

Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
Duplicate class androidx.lifecycle.ViewTreeViewModelKt found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.1-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.1)
eltos commented 1 year ago

This was an issue with androidx.appcompat:appcompat:1.5.0. However, v2.6.4 of my library uses appcompat:1.5.1 where the issue has been fixed. The dependency introduced by simpledialogfragments is lifecycle:2.5.1. The conflicting lifecycle:2.3.1 must come from another package you rely upon. As suggested in the issue linked above, you might be able to fix it by adding an explicit dependency on lifecycle:2.5.1 to your main module:

implementation "androidx.lifecycle:lifecycle-viewmodel:2.5.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1"
isabsent commented 1 year ago
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1" works, thanks!
eltos commented 1 year ago

Glad I could help, have a nice weekend :)