1

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'.")

straya
  • 5,002
  • 1
  • 28
  • 35

1 Answers1

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