java.lang.RuntimeException : java. lang.RuntimeException : Duplicate class bolts. 在模块 jetified-bolts-tasks-1.24.1.jar 中发现 AggregateException

标签 java android json gradle jar

您好,目前我正在开发包括解析服务器的项目,并且在将解析库添加到我的项目后,当我运行它时,它显示此错误,任务“:app:checkDebugDuplicateClasses”执行失败。

    Execution failed for task ':app:checkDebugDuplicateClasses'.
> 1 exception was raised by workers:
  java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class bolts.AggregateException found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.AndroidExecutors found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.AndroidExecutors$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.AndroidExecutors$UIThreadExecutor found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.BoltsExecutors found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.BoltsExecutors$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.BoltsExecutors$ImmediateExecutor found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.CancellationToken found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.CancellationTokenRegistration found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.CancellationTokenSource found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.CancellationTokenSource$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Capture found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Continuation found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.ExecutorException found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$10 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$11 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$12 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$13 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$14 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$15 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$15$1 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$2 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$3 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$4 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$5 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$6 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$7 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$8 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$9 found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$TaskCompletionSource found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.Task$UnobservedExceptionHandler found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.TaskCompletionSource found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.UnobservedErrorNotifier found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.0)
  Duplicate class bolts.UnobservedTaskException found in modules jetified-bolts-tasks-1.24.1.jar (com.github.parse-community.Parse-SDK-Android:bolts-tasks:1.24.1) and jetified-bolts-tasks-1.4.0.jar (com.parse.bolts:bolts-tasks:1.4.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

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.4-rc-2/userguide/command_line_interface.html#sec:command_line_warnings

最佳答案

您是否尝试排除重复的模块?
我尝试从 Parse SDK 中删除额外的内容。

implementation ("com.github.parse-community.Parse-SDK-Android:parse:$parseVersion"){
    exclude group: 'com.github.parse-community.Parse-SDK-Android', module: 'bolts-tasks'
}

// for Google login/signup support (optional)
implementation ("com.github.parse-community.Parse-SDK-Android:google:$parseVersion"){
    exclude group: 'com.github.parse-community.Parse-SDK-Android', module: 'bolts-tasks'
}

// for Facebook login/signup support (optional)
implementation ("com.github.parse-community.Parse-SDK-Android:facebook:$parseVersion"){
    exclude group: 'com.github.parse-community.Parse-SDK-Android', module: 'bolts-tasks'
}

// for Twitter login/signup support (optional)
implementation ("com.github.parse-community.Parse-SDK-Android:twitter:$parseVersion"){
    exclude group: 'com.github.parse-community.Parse-SDK-Android', module: 'bolts-tasks'
}

// for FCM Push support (optional)
implementation ("com.github.parse-community.Parse-SDK-Android:fcm:$parseVersion"){
    exclude group: 'com.github.parse-community.Parse-SDK-Android', module: 'bolts-tasks'
}

// for Kotlin extensions support (optional)
implementation ("com.github.parse-community.Parse-SDK-Android:ktx:$parseVersion"){
    exclude group: 'com.github.parse-community.Parse-SDK-Android', module: 'bolts-tasks'
}

关于java.lang.RuntimeException : java. lang.RuntimeException : Duplicate class bolts. 在模块 jetified-bolts-tasks-1.24.1.jar 中发现 AggregateException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61414006/

相关文章:

javascript - Node 在服务器和客户端之间共享数据

javascript - 如何从 eBay api 获取 Json 数据以保存为 CSV 格式?

java - 是否可以覆盖 DateFormat.getDateTimeInstance()?

java - 线程中出现异常 "main"java.util.NoSuchElementException : No line found, 出了什么问题?

android - 使用android intent在特定时间打开youtube视频

android - 来自支持库与设计库的抽屉导航

javascript - 如何将错误消息关联到 json 响应中的 'error' 键

java - 如何将其他书面方法与本方法结合使用

java - Spinner 不使用 API 23 中的 onItemSelected 方法

java - android/java - 解析不同结构的 JSON 响应