When building for API 21 emulator in Android Studio 4.0.1 I get the error: "Entry name 'META-INF/MANIFEST.MF' collided". Building for other platform versions, emulator or device does work. Any ideas what might be wrong? My guess is there is a collision related to backward compatibility dependencies that Android build process injects for API 21, the error message does not help to isolate the problem. Running the build task itself t get more log output yields no problems ("Task execution finished 'build'.")
Asked
Active
Viewed 556 times
1
-
I faced the same issue. The problem was solved after I updated most of the libraries to the latest versions – Svetlana Rozhkova Nov 03 '20 at 12:49
-
Did you find a solution to this @straya? – sparkhead95 Nov 06 '20 at 12:22
-
I've continued to have problems with old emulators like this in recent years, sorry. I don't think I ever saw a fix for that case. – straya Nov 11 '20 at 01:22
-
See similar [error](https://stackoverflow.com/questions/60406047) and [possible solutions](https://stackoverflow.com/a/68501093/1633493) – GSD.Aaz Jul 23 '21 at 15:14
1 Answers
0
I had [the same issue][1]. At issue' comments I got link to [another issue][2], 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
}
}
Main point: The outputFileName API doesn't officially support changing the output file path. A workaround would be to leave the outputFileName unchanged and instead add some post processing to copy to the desired location.

GSD.Aaz
- 178
- 2
- 6