AndroidStudio packaged the apk and reported Error:Execution failed for task':app:packageRelease'

Error: Error: Execution failed for task':app:packageRelease' is reported when signing and packaging apk, as shown below

All kinds of cleans and restarting Studio are of no use. Various other errors were reported during the period as follows:

Cause: invalid block type

Cause: invalid distance too far back

Entry 'res/drawable-xxhdpi-v4/loading_16.png' name differ 

Failed to create 'D:\AndroidCode\app\build\outputs\apk\debug\myApp_2.1.apk'

Seeing that the last error is failure to create apk, look at the above Error: Execution failed for task':app:packageRelease'

Then I thought that I did apk subcontracting:

Then make a custom modification to the apk name:

The problem lies in this modification of the apk name. Because of my sub-package processing, three apk packages will be output: armeabi-v7a package, arm64-v8a package, and armeabi-v7a+arm64-v8a package

But this double-named apk will make the names of the three packages the same, so that the problem of duplicate names occurs when packaging, and an exception is reported.

Then modified the code to rename the apk:

Then the packaging is normal. The package names are as follows:

This bug may be special because it happens to be sub-packaged and the package name is customized and modified. This is a coincidence.

Guess you like

Origin blog.csdn.net/u011288271/article/details/109982387