23

After update to Android studio 3.6 Canary11 (macOS) I cannot run nor run Debug variants of my project (Release variants working fine).

When I try to run the project I've got error:

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
  > Entry name 'firebase-abt.properties' collided

But when I delete build directory (rm -rf app/build), I can run/debug project once time. After the first run, it is again with the same error with collision.

I try clear cache, restart the Android studio, but it didn't help.

Maybe it is not related to Android studio, because different project running ok. Do you have any idea, what the problem may be?

Rado Dr.
  • 425
  • 1
  • 3
  • 10

12 Answers12

60

I was facing the same error as MrEngineer13. After hours of struggle turns out you have to delete the built APK files for the project to build another APK successfully

Sdghasemi
  • 5,370
  • 1
  • 34
  • 42
  • 2
    Thank you so much. I struggled a lot with figuring out a similar issue `Entry name org/joda/time/tz/data/Europe/Dublin collided` when generating an APK file. Deleting the previously generated APK (in its respective build folder) seems to have solved the issue. – Johnny Jun 23 '20 at 01:16
  • I'm recently getting `Entry name 'org/apache/commons/codec/language/bm/gen_approx_greeklatin.txt' collided` myself with the latest stable version of Android Studio (v4.0). Starting from v3.6.0 AS became a joke. – Sdghasemi Jun 23 '20 at 12:44
  • Thanks a lot. Saved me a lot of time. – Amey Bhandarkar Jul 20 '20 at 06:39
  • what a hecking bug! – AllwiN Mar 24 '23 at 08:36
11

I had a similar issue with Android Studio 3.6 Canary 12 on Mac, I could build different build variants but had this error when I tried to Generate a signed apk:

Entry name 'kotlin/collections/MapWithDefault.kotlin_metadata' collided

I had to delete the .build folder as well as the folders where I build my build variant.

MrEngineer13
  • 38,642
  • 13
  • 74
  • 93
8

I faced somehow similar issue on Android Studio 3.6.3v

Entry name 'kotlin/collections/MapWithDefault.kotlin_metadata' collided

I resolved the issue by:

  1. Delete build folder under /app
  2. Clean project
  3. Rebuild project

If still doesn't work, do the following:

File > Invalidate Caches/Restart
Waqar UlHaq
  • 6,144
  • 2
  • 34
  • 42
3

I just had a similar issue - my generating a debug build variant kept failing with an error about "Entry name res/layout/test_toolbar.xml collided". There is no "test_toolbar_xml" anywhere in my project. I first deleted all build directories and tried - same result. then I went in and deleted caches under .gradle\5.6.4, and under .idea folders. Tried again and this time I was able to build.

Building a "release" variant worked every time.

tfrysinger
  • 1,306
  • 11
  • 26
3

Delete apk file from subfolders project

1

try build.gradle

android {
    packagingOptions {
    pickFirst  'firebase-abt.properties'
    }
}
Ernest
  • 222
  • 2
  • 12
1

If anyone is still facing this issue, try this -

  1. Step 1
File > Invalidate Caches/Restart
  1. Step 2
Rebuild Project
spiraldev
  • 171
  • 1
  • 3
1

This is caused by the Android studio's new default packaging tool called zipflinger

You have to set the following in your gradle.properties file to fix the issue.

android.useNewApkCreator=false

Reference: https://developer.android.com/studio/releases/gradle-plugin?authuser=1#zipflinger

0
  1. After upgrading Gradle, compilation (debug) failed. I got the compilation error message:

Entry name 'res/mipmap-hdpi-v4/ic_launcher.png' collided

  1. Tried the article https://medium.com/@elye.project/resources-collision-without-warning-b29294f518c6 by Elye. I am using a library where ic_launcher is also defined. I renamed the ic_launcher according to recommendations in the article, but that did not solve the problem.

  2. Tried to clear the cache by deleting the build and gradle directory, but that did not solve the problem.

  3. Tried to set in gradle.properties:android.useNewApkCreator=false but then Android Studio reports: build.gradle: The option setting android.useNewApkCreator=false is experimental and unsupported.

  4. Since I am not up to using experimental features, I downgraded from:
    Gradle Version: 3.6.1 Android Plugin version: 6.2.1
    to:
    Gradle Version: 3.5.3 Android Plugin version: 5.4.1

Compilation (debug) now works again.

SimplyProgrammer
  • 1,799
  • 2
  • 17
  • 28
tomd
  • 1
0

I faced the same problem. I just clean and rebuild, and it's working fine after that.

imin
  • 4,504
  • 13
  • 56
  • 103
0

When getting a entry name 'kotlin/collections/mapwithdefault.kotlin_metadata' collided error in Android Studio v3.6.1 it helped cleaning the build folders.

We ended up creating a script for this: cleanBuldFolders.sh

#!/bin/bash

# Deletes all build folders in the project
find . -name build -type d -exec rm -rf {} +
PålOliver
  • 2,502
  • 1
  • 23
  • 27
0

I faced the same issue when using Android Studio 4.0 Canary 8.

I solved my problem by downgrading from:

Gradle version 3.6.3 to 3.5.3

Android plugin version 5.6.1 to 5.4.1

BUT

I would suggest try these below options before downgrading

  • Delete build folder inside app
  • Clean
  • Rebuild

If you still face the issue, try Invalidate Cache / Restart

Community
  • 1
  • 1
Amir Raza
  • 2,320
  • 1
  • 23
  • 32