Problem "Entry name 'META-INF...' collide - Android

Viewed 19954

I have added some things to my mobile application, such as adds or animation-lists. The thing is that I could generate APKs perfectly some days ago and, since the moment y added those things, Android Studio does not let me generate them. It has the following error.

Entry name 'META-INF/androidx.vectordrawable_vectordrawable.version' collided

Or these other ones:

Execution failed for task ':app:packageDebug'. A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade Entry name 'META-INF/androidx.vectordrawable_vectordrawable.version' collided

I have no idea what could get wrong. Thank you so much.

10 Answers

I had the similar problem with "META-INF/androidx.gridlayout_gridlayout.version' collided". It took my 4 hours and finally i resolved it. Method which worked for me i am not sure that will for you too but you can try. go to Menu Build > Rebuild Project thats it.

In my case in the output directory there has already been a file called app-debug.apk and for whatever reason the android sdk could not overwrite it. The apk has been generated as soon as I deleted or renamed the old version.

Delete the previous APK you build and try again. it helps me to solve this issue.

  • Click on Build -> Clean Project
  • Click on File -> Invalidate Caches / Restart

Still you have the same error then delete debug and release folder from the app folder then restart the IDE

Use in the below steps will working perfectly.

Menu -> Build -> Clean project

that's all. Enjoy your coding.

I had the same problem with my project Clean Project, as well as Rebuild Project, which worked for me.

Check this for more

In my case, I just rebuild the project. solved my problem

In my case , I deleted the debug and release directory


Solution Clean Project works, but it is not useful do clean every time before Run.
So I created the the issue. And at issue' comments I got link to another issue, then I got solution, which works for me.

My project has the following lines at build.gradle(:app) specially for TeamCity

applicationVariants.all { variant ->
    variant.outputs.all {
        outputFileName = "../../" + outputFileName
    }
}

But it crash local build process.

So I just add condition and fix the issue!

applicationVariants.all { variant ->
    variant.outputs.all {
        if (rootProject.hasProperty("teamcity"))
            outputFileName = "../../" + outputFileName
    }
}

sometimes cleaning and rebuilding the project is enough to resolve the issue but if not you can delete a previously generated debug apk from a project folder. generally, it happens when you create a building project first time after switching the branch or getting the latest changes from git, or changing the build variant.

Related