Во время сборки Generate Singed Apk ошибка (ошибка на все PNG изображения в проекте, даже на ic_launcher.png, без PNG ресурсов apk собирается):
Execution failed for task ':app:mergeReleaseResources'.
> Multiple task action failures occurred:
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.1.0-6503028-windows Daemon #1: Unexpected error during compile 'E:\Android\test\app\src\main\res\mipmap-xxxhdpi\ic_launcher.png', attempting to stop daemon.
This should not happen under normal circumstances, please file an issue if it does.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> AAPT2 aapt2-4.1.0-6503028-windows Daemon #2: Unexpected error during compile 'E:\Android\test\app\src\main\res\mipmap-xxhdpi\ic_launcher_round.png', attempting to stop daemon.
Android Studio 4.1
//project
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.test"
minSdkVersion 21
targetSdkVersion 29
versionCode 8
versionName '1.8'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
shrinkResources true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
// modules
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
Отключение - не помогает.
shrinkResources true
minifyEnabled true
Invalidate Caches и Удаление папки .gradle - не помогает.
Помогает только изменение версии Android Gradle Plugin Version на 4.0.2.