Building a signed .apk on macOS with Gradle plugin 3.6.1

I recently updated to Android Studio 3.6.1 and then upgraded all of my projects to use Android Gradle Plugin 3.6.1 and Gradle version 5.6.4, which has created a problem building signed .apk files.

The problem happens whenever I do this:

  1. Run > Run “MainActivity”
  2. Build > Generate Signed Bundle / APK …

The build fails with errors that look like this, although the specific entry name collision may vary.:

Entry name ‘res/interpolator/btn_checkbox_checked_mtrl_animation_interpolator_0.xml’ collided

I have raised a bug and it has been accepted and assigned but in the meantime whenever I want to build a signed .apk on macOS I need to do the following:

  1. File > Project Structure…
  2. Change Android Gradle Plugin Version to 3.6.0
  3. Click the OK button
  4. Wait for Android studio to recommend a plugin update
  5. Click the update link
  6. Click the Update button
  7. Build > Generate Signed Bundle / APK …

From that point everything works as expected.  So until the Android Studio folks fix this, it looks like this is the fastest way to build a signed .apk file.

As a side note, you can continue to build signed .apk files until you Run the MainActivity again (maybe for debugging) after which you will need to go through this procedure again.


Leave a comment