@TOC
After the computer reinstalls the system, the problem of Execution failed for task ':app:signingConfigWriterDebug' appears
Introduction: After reinstalling the computer system, install the latest version of Android Studio, open the previous project, and prompt the following error when running:
Execution failed for task ':MvcMvpMvvmDemo:signingConfigWriterDebug'.
> java.nio.file.AccessDeniedException: D:\code\androidCode\MyExample\MvcMvpMvvmDemo\build\intermediates\signing_config\debug\out\signing-config.json
* 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.
Cause analysis:
After reinstalling the system, the user has been changed, and the user permissions of the original file are not applicable to the new user, and there is no corresponding permission, resulting in build failure.
Solution:
- Open
<project_dir>\build\app\intermediates\signing_config\debug\out
, right click after entering the foldersigning-config.json
, open Properties->Security->Advanced, as shown in the following figure:
- Click the "Advanced" option:
- Click the "Change (C)" option: select a user or group, enter the current computer user name in the box, click Check Name, Confirm, Apply.
- Open the properties window again, edit the corresponding permissions and compile again:
- After editing and modifying, rebuild the project, and then you can run the project successfully.