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:
- Run > Run “MainActivity”
- 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:
- File > Project Structure…
- Change Android Gradle Plugin Version to 3.6.0
- Click the OK button
- Wait for Android studio to recommend a plugin update
- Click the update link
- Click the Update button
- 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.
Sigh…