0

Suddenly I am getting this build problem when generating an APK. I have no idea what it means or how to resolve it. The changes I made from the previous time I built were minimal, and I even reverted to the previous version with no luck. Please assist:

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

Update: Ran app:dependencies

+--- 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 (*)





Cb32019
  • 185
  • 1
  • 13

2 Answers2

0

At first sight it seems that there is a collision in your dependencies - I suspect you have 2 different versions of Hilt being included in your project.

Please run the Gradle :app:dependencies task (or the corresponding one to your project structure) and check the output to verify what may be causing the collision (search for Hilt entries).

mrpasqal
  • 1,000
  • 1
  • 6
  • 26
  • I updated the post with the entries regarding Hilt. Sorry I can't figure out if things are conflicting. Could you help? – Cb32019 Oct 28 '20 at 18:38
  • It seems it's not a valid way to go. However i just made a small research and this looks similar: https://stackoverflow.com/questions/62280809/problem-entry-name-meta-inf-collide-android. I believe it might help you. – mrpasqal Oct 29 '20 at 18:32
0

Turns out my situation was a bug in Android studio. I duplicated "staging" and named it "staging2", and it worked fine.

Cb32019
  • 185
  • 1
  • 13