android - 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 (*)
解决方案
原来我的情况是Android工作室中的一个错误。我复制了“staging”并将其命名为“staging2”,它运行良好。
推荐阅读
- python - 框架瓶和 OSError
- c++ - 在 C++ 中,哪个占用更多空间,是 hashmap 还是结构数组?哪个更快?
- spring - 如何使用spring security oauth2进行amazon sp-api第三方授权
- javascript - 使用本地文件中的实时数据的最佳方式
- c# - .Net core 3.1 web api中的MS单元测试-我们如何在服务级别模拟restclient请求响应?
- docker-compose - 远程尝试执行 docker-compose 时出错“拨号 unix /var/run/docker.sock:连接:权限被拒绝”
- angular - 来自自定义字符串的 Angular Epoch 日期
- c# - CSV Helper 在分隔符后将字符串字段“名称”包装成双引号?
- javascript - 表单中的 POST 方法返回 null
- c# - 在 ASP.NET MVC 中添加要查看的表单