摇篮 |安卓 |重复类 androidx.work 问题 | androidx.workmanager

问题描述 投票:0回答:0

尝试构建时执行失败,以下是错误

任务“:app:checkReleaseDuplicateClasses”执行失败。

执行 com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable 时发生故障 在模块 work-runtime-2.8.1-runtime (androidx.work:work-runtime:2.8.1) 和 work-runtime-ktx-2.7.1-runtime (androidx.work:work) 中发现重复的类 androidx.work.OneTimeWorkRequestKt -运行时-ktx:2.7.1) 在模块 work-runtime-2.8.1-runtime (androidx.work:work-runtime:2.8.1) 和 work-runtime-ktx-2.7.1-runtime (androidx.work:work) 中发现重复的类 androidx.work.PeriodicWorkRequestKt -运行时-ktx:2.7.1)

 Go to the documentation to learn how to <a href="d.android.com/r/tools/classpath-sync-errors">Fix dependency resolution errors</a>.

我尝试强制将版本设置为2.8.1作为其最新的稳定版本。

 implementation("androidx.work:work-runtime-ktx:2.7.1:$androidxWorkWork"){ force = true }

定义

$androidxWorkWork = "2.8.1" 

预计课程会选择 2.8.1,但我看到一个新错误,未找到特定包。

任务“:app:checkReleaseDuplicateClasses”执行失败。

无法解析配置“:app:releaseRuntimeClasspath”的所有文件。 无法转换 work-runtime-ktx-2.7.1-2.8.1.jar (androidx.work:work-runtime-ktx:2.7.1) 以匹配属性 {artifactType=enumerated-runtime-classes, org.gradle.libraryelements =jar, org.gradle.status=release, org.gradle.usage=java-runtime}。 > 找不到 work-runtime-ktx-2.7.1-2.8.1.jar (androidx.work:work-runtime-ktx:2.7.1)。 在以下位置进行了搜索: https://nexus.rbfcu.org/repository/maven-public/androidx/work/work-runtime-ktx/2.7.1/work-runtime-ktx-2.7.1-2.8.1.jar

以下是build.gradle中应用程序的依赖项

dependencies {
implementation "androidx.core:core-splashscreen:$coreSplashScreenVersion"
implementation "androidx.coordinatorlayout:coordinatorlayout:$androidxCoordinatorLayoutVersion"
implementation "androidx.appcompat:appcompat:$androidxAppCompatVersion"
implementation project(':capacitor-android')
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0"
implementation("androidx.work:work-runtime-ktx:2.7.1:$androidxWorkWork"){
force = true


Env:离子 + 角度

有什么建议可以做吗?

javascript kotlin android-gradle-plugin build.gradle android-workmanager
© www.soinside.com 2019 - 2024. All rights reserved.