Execution failed for task ':app:mergeReleaseResources'. 错误解决

今天在打包时 报错:

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeReleaseResources'.

Error: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

原因是 资源文件有问题、我的string 文件只有CN 、没做US 适配

懒式解决方法:

aaptOptions.cruncherEnabled = false
aaptOptions.useNewCruncher = false

lintOptions {
    checkReleaseBuilds false
    abortOnError false
}

然后就可以打包了

你可能感兴趣的:(Execution failed for task ':app:mergeReleaseResources'. 错误解决)