I tried to run my project on my phone, and I got the following error message(s):
Duplicate class androidx.compose.ui.AbsoluteAlignment found in modules ui-desktop-1.6.7.jar -> jetified-ui-desktop-1.6.7 (androidx.compose.ui:ui-desktop:1.6.7) and ui-release.aar -> jetified-ui-release-runtime (androidx.compose.ui:ui-android:1.6.7)
Duplicate class androidx.compose.ui.Actual_jvmKt found in modules ui-desktop-1.6.7.jar -> jetified-ui-desktop-1.6.7 (androidx.compose.ui:ui-desktop:1.6.7) and ui-release.aar -> jetified-ui-release-runtime (androidx.compose.ui:ui-android:1.6.7)
Duplicate class androidx.compose.ui.Actual_jvmKt$tryPopulateReflectively$$inlined$sortedBy$1 found in modules ui-desktop-1.6.7.jar -> jetified-ui-desktop-1.6.7 (androidx.compose.ui:ui-desktop:1.6.7) and ui-release.aar -> jetified-ui-release-runtime (androidx.compose.ui:ui-android:1.6.7)
Duplicate class androidx.compose.ui.Alignment found in modules ui-desktop-1.6.7.jar -> jetified-ui-desktop-1.6.7 (androidx.compose.ui:ui-desktop:1.6.7) and ui-release.aar -> jetified-ui-release-runtime (androidx.compose.ui:ui-android:1.6.7)
Duplicate class androidx.compose.ui.Alignment$Companion found in modules ui-desktop-1.6.7.jar -> jetified-ui-desktop-1.6.7 (androidx.compose.ui:ui-desktop:1.6.7) and ui-release.aar -> jetified-ui-release-runtime (androidx.compose.ui:ui-android:1.6.7)
dinator$LookaheadDelegateImpl found in modules ui-desktop-1.6.7.jar -> jetified-ui-desktop-1.6.7 (androidx.compose.ui:ui-desktop:1.6.7) and ui-release.aar -> jetified-ui-release-runtime (androidx.compose.ui:ui-android:1.6.7)
+ 880 more cases of these "Duplicate class exceptions"... (as I would've exceeded well past the character limit at that point)
I added the “android.enableJetifier=true” in my gradle.properties file and it didn’t work at all. I also tried the following 4 steps…
- Select Navigate > Class from the menu bar.
- In the pop-up search dialog, make sure that the box next to Include non-project items is checked.
- Type the name of the class that appears in the build error.
- Inspect the results for the dependencies that include the class
The problem with the above steps is that there are way too many duplicate classes (885 to be exact).
I even tried to rebuild and clean project but to no avail. The irony of this error, is that they don’t seem to be affected by the plugins that are being used by the application (regardless of whether it’s been upgraded or downgraded).