Skip to content
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

Version conflict for com.intellij:annotations dependency #5

Open
TheTimemaster opened this issue Jul 13, 2021 · 2 comments
Open

Version conflict for com.intellij:annotations dependency #5

TheTimemaster opened this issue Jul 13, 2021 · 2 comments

Comments

@TheTimemaster
Copy link

The package has an implementation 'com.intellij:annotations:+@jar dependency, that will download annotations in 12.0 version, released in 2013, as this is the latest under com.intellij name.

Jetifier includes annotations:13.0 directly in its library, and that creates duplicate class conflicts when building.

I am not a native android developer, so I am not completely sure if this is a valid solution. Having said that, newer versions of the annotations library, including 13, are available under org.jetbrains:annotations on various repositories, and changing the dependency to implementation 'org.jetbrains:annotations:+@jar has resolved the issue, at least for me.

Error details:

Jetifier version: 1.6.6
Build error:


> Task :react-native-admob-next:compileDebugJavaWithJavac

> Task :app:checkDebugDuplicateClasses FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
439 actionable tasks: 8 executed, 431 up-to-date
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: Duplicate class org.intellij.lang.annotations.Identifier found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$AdjustableOrientation found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$BoxLayoutAxis found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$CalendarMonth found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$CursorType found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$FlowLayoutAlignment found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$FontStyle found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$HorizontalAlignment found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$InputEventMask found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$ListSelectionMode found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$PatternFlags found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TabLayoutPolicy found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TabPlacement found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderJustification found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TitledBorderTitlePosition found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.JdkConstants$TreeSelectionMode found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.Language found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.MagicConstant found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.Pattern found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.PrintFormat found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.PrintFormatPattern found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.RegExp found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.intellij.lang.annotations.Subst found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.jetbrains.annotations.Nls found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.jetbrains.annotations.NonNls found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.jetbrains.annotations.NotNull found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.jetbrains.annotations.Nullable found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.jetbrains.annotations.PropertyKey found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  Duplicate class org.jetbrains.annotations.TestOnly found in modules annotations-12.0.jar (com.intellij:annotations:12.0) and annotations-13.0.jar (org.jetbrains:annotations:13.0)
  
  Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 15s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.

Process finished with exit code 1

@quan2nd
Copy link

quan2nd commented Jul 17, 2021

https://stackoverflow.com/questions/58903820/java-lang-runtimeexception-duplicate-class-org-intellij-lang-annotations-flow-f
It worked for me

ericlathrop added a commit to DerbyWars/react-native-admob-next that referenced this issue Jul 26, 2021
@rochapablo
Copy link

rochapablo commented Aug 4, 2021

After have solved this, I got another error #6

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