首页 > 解决方案 > Gradle 生成 APK -- 条目名称 'META-INF/androidx.hilt_hilt-common.version' 冲突

问题描述

突然我在生成 APK 时遇到了这个构建问题。我不知道这意味着什么或如何解决它。我上次构建时所做的更改很少,我什至没有运气就恢复到以前的版本。请协助:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageStaging'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Entry name 'META-INF/androidx.hilt_hilt-common.version' collided

更新:运行应用程序:依赖项

+--- androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha02
|    +--- androidx.annotation:annotation:1.1.0
|    +--- androidx.hilt:hilt-common:1.0.0-alpha02
|    +--- androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0 (*)
|    \--- com.google.dagger:hilt-android:2.28-alpha (*)


+--- com.google.dagger:hilt-android:{strictly 2.28-alpha} -> 2.28-alpha (c)

+--- androidx.hilt:hilt-common:{strictly 1.0.0-alpha02} -> 1.0.0-alpha02 (c)

+--- com.google.dagger:hilt-android:2.28-alpha
|    +--- com.google.dagger:dagger:2.28
|    |    \--- javax.inject:javax.inject:1
|    +--- com.google.dagger:dagger-lint-aar:2.28
|    +--- com.google.code.findbugs:jsr305:3.0.1
|    +--- androidx.activity:activity:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.core:core:1.1.0 -> 1.3.0 (*)
|    |    +--- androidx.lifecycle:lifecycle-runtime:2.2.0 (*)
|    |    +--- androidx.lifecycle:lifecycle-viewmodel:2.2.0
|    |    |    \--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.savedstate:savedstate:1.0.0
|    |    |    +--- androidx.annotation:annotation:1.1.0
|    |    |    +--- androidx.arch.core:core-common:2.0.1 -> 2.1.0 (*)
|    |    |    \--- androidx.lifecycle:lifecycle-common:2.0.0 -> 2.2.0 (*)
|    |    \--- androidx.lifecycle:lifecycle-viewmodel-savedstate:1.0.0 -> 2.2.0
|    |         +--- androidx.annotation:annotation:1.0.0 -> 1.1.0
|    |         +--- androidx.savedstate:savedstate:1.0.0 (*)
|    |         +--- androidx.lifecycle:lifecycle-livedata-core:2.2.0
|    |         |    +--- androidx.lifecycle:lifecycle-common:2.2.0 (*)
|    |         |    +--- androidx.arch.core:core-common:2.1.0 (*)
|    |         |    \--- androidx.arch.core:core-runtime:2.1.0
|    |         |         +--- androidx.annotation:annotation:1.1.0
|    |         |         \--- androidx.arch.core:core-common:[2.1.0] -> 2.1.0 (*)
|    |         \--- androidx.lifecycle:lifecycle-viewmodel:2.2.0 (*)





标签: androidgradleandroid-gradle-pluginbuild.gradle

解决方案


原来我的情况是Android工作室中的一个错误。我复制了“staging”并将其命名为“staging2”,它运行良好。


推荐阅读