Skip to content

Duplicate class in androidx.annotation #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Nek-12 opened this issue Jul 30, 2024 · 9 comments
Closed

Duplicate class in androidx.annotation #61

Nek-12 opened this issue Jul 30, 2024 · 9 comments

Comments

@Nek-12
Copy link

Nek-12 commented Jul 30, 2024

Build fails with:

Duplicate class androidx.annotation.AnimRes found in modules annotation-desktop-1.8.0-alpha01.jar -> annotation-desktop-1.8.0-alpha01 (org.jetbrains.compose.annotation-internal:annotation-desktop:1.8.0-alpha01) and annotation-jvm-1.8.1.jar -> annotation-jvm-1.8.1 (androidx.annotation:annotation-jvm:1.8.1)

Usage:

commonMain.dependencies {
    api(libs.compose.constraintlayout)
}

Other modules use other androidx. libraries. All modules use only this artifact for constraint layout. transitive dependencies may use the original artifact (unknown)

Workaround:
See comments below.

@Lavmee
Copy link
Owner

Lavmee commented Jul 30, 2024

At the moment, the internal JetBrains library cannot be replaced with the official one, since there is no JS target there.

@Nek-12 Nek-12 changed the title Duplicate clas in androidx.annotation Duplicate class in androidx.annotation Jul 30, 2024
@Monabr
Copy link

Monabr commented Aug 18, 2024

@Nek-12 Workaround does not works for me.

Duplicate class androidx.constraintlayout.core.ArrayLinkedVariables found in modules compose-release.aar -> compose-release-runtime (tech.annexflow.compose:constraintlayout-compose-multiplatform-android:0.5.0-alpha01) and constraintlayout-core-1.0.4.jar -> constraintlayout-core-1.0.4 (androidx.constraintlayout:constraintlayout-core:1.0.4)

@Monabr
Copy link

Monabr commented Aug 23, 2024

@Lavmee How to solve this issue? This is critical blocker for me. I can't build and run the application.

Library is not working because of this.

@Monabr
Copy link

Monabr commented Aug 23, 2024

@Lavmee Currently there is no way to use this library.


compose-multiplatform: 1.6.11
library: 0.4.0

result: Cannot access 'var visibility: Visibility': it is private in 'androidx/constraintlayout/compose/ConstrainScope'


compose-multiplatform: 1.7.0-alpha3
library: 0.5.0-alpha01

result: Duplicate class androidx.constraintlayout.core.ArrayLinkedVariables found in modules compose-release.aar -> compose-release-runtime (tech.annexflow.compose:constraintlayout-compose-multiplatform-android:0.5.0-alpha01) and constraintlayout-core-1.0.4.jar -> constraintlayout-core-1.0.4 (androidx.constraintlayout:constraintlayout-core:1.0.4)


This need to be fix as soon as possible.

@Lavmee
Copy link
Owner

Lavmee commented Aug 23, 2024

@Monabr, I'll check everything today.

@Monabr
Copy link

Monabr commented Aug 23, 2024

@Lavmee Turns out it was other dependency with constraintlayout in it.

@Monabr
Copy link

Monabr commented Aug 24, 2024

@Lavmee @Nek-12
The library is, however, out of order.

If I apply the ticket author's solution

api(libs.compose.constraintlayout.get().toString()) {
    exclude(group = "org.jetbrains.compose.annotation-internal")
}

Then when I build the project on IOS I get

KLIB resolver: Could not find "org.jetbrains.compose.annotation-internal:annotation"

If I remove exclude(group = "org.jetbrains.compose.annotation-internal") then I get the error again Duplicate class

What should I do about this? It is very frustrating that I cannot use the library. Please fix this problem.

@Nek-12

This comment was marked as abuse.

@Lavmee
Copy link
Owner

Lavmee commented Aug 25, 2024

Should be fixed in version 0.5.0-alpha03. If there are any problems, write here.

@Lavmee Lavmee closed this as completed Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants