build 打包报错:Execution failed for task ‘,Run with --stacktrace option to get the stack trace.

Background: After a long time, the project was opened and packaged again and an error was reported:

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:mergeReleaseResources'.
> Couldn't delete stale output file

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:signingConfigWriterRelease'.
> Couldn't delete stale output file

* 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.

 I began to suspect that the studio version was updated, and the gradle version in the project was too low.

Modify the project gradle version to the version in other normal projects

 Repackage after modification:

Still reporting an error, but solved one.

 After that, click build.gradle(:app): I found an error message in the upper right corner

 click open

 Modify the targetSdk version, note that the targetSdk version under each module must be modified

 Then the error is still reported, after the clean project, the build files that cannot be deleted are manually deleted in the folder, and then the rebuild project is packaged successfully.

The above are the solution process notes I recorded when a bug occurred.

 

 

Guess you like

Origin blog.csdn.net/xxfen_/article/details/128527878