https://kotlinlang.org logo
Title
a

Adam Brown

02/21/2021, 3:02 AM
I have the desktop client building and running now, however when I go to build the Android client, I get a raft of duplicate class errors. I've been poking around at the dependencies for a while but can't make any progress, anyone run into this before? this repo: https://github.com/Wavesonics/notional
Duplicate class androidx.compose.animation.AlignmentBasedSizeAnimation$animateTo$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AlignmentBasedSizeAnimation$offset$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimStates found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibility$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibility$2 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibility$3 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$2 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$2$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$3 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
  Duplicate class androidx.compose.animation.AnimatedVisibilityKt$AnimatedVisibilityImpl$animations$1$1 found in modules animation-1.0.0-alpha12-runtime.jar (androidx.compose.animation:animation:1.0.0-alpha12) and animation-debug-runtime.jar (org.jetbrains.compose.animation:animation-android-debug:0.3.0-build152)
:thread-please: 1
s

SaurabhS

02/21/2021, 4:42 AM
That's probably because you're using the
"androidx.compose.*"
dependencies instead of
compose.*
in your android build.gradle.
a

Adam Brown

02/21/2021, 4:47 AM
ok, so that certainly fixes that problem.
huh but I need
setContent
which it now tells me is internal
Cannot access 'setContent': it is internal in 'androidx.compose.ui.platform'
k

kevindmoore

02/21/2021, 4:49 AM
I’m just starting this myself but I would think that if you are in the Android project, you should use Android compose, not desktop
🇳🇴 1
I’m using Android compose and it’s working great
s

SaurabhS

02/21/2021, 4:50 AM
I believe the exclude workaround should not be necessary when a newer build arrives. The compose plugin now handles it itself.
:yes: 1
a

Adam Brown

02/21/2021, 4:50 AM
ya the whole multiplatform compose is... very early. i've been banging my head against it all day
j

jim

02/21/2021, 6:11 PM
The whole multiplatform configuration is complicated to configure in large part because widgets which publish dependencies on Google's binaries are incompatible with widgets which publish dependencies on the Jetbrains binaries (you can work around this by using only widgets/libraries intended for desktop, or by oftentimes you can use exclude rules to force libraries to work). This is a known issue, and one we're working hard to resolve, but there are some logistical intricacies and processes that we need to go through so it may take a bit of time.
a

Adam Brown

02/21/2021, 6:14 PM
oh got ya, okay
j

Javier

04/21/2021, 7:21 AM
@jim is there a Google or GitHub issue open about this? I am looking for it with no luck
j

jim

05/03/2021, 5:51 PM
We're still working on a better long term fix for this, but it is temporarily mitigated by https://github.com/JetBrains/compose-jb/commit/d26c8f5c153d277923959a9285d727a5d85aae4c I don't think we had a public issue for this, so I went ahead and created one: https://issuetracker.google.com/issues/187071114 FWIW, this is a high-priority item for us, and it has an internal roadmap dates attached to it, but it takes time as there are a bunch of logistical intricacies and processes that we need to go through.
👍 2
:tnx: 1
j

Javier

05/03/2021, 5:52 PM
Thank you for the detailed info Jim :)