After reinstalling the system on the computer, Android Studio has the problem of Execution failed for task ':app:signingConfigWriterDebug'

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

insert image description here

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:

  1. Open <project_dir>\build\app\intermediates\signing_config\debug\out, right click after entering the folder signing-config.json, open Properties->Security->Advanced, as shown in the following figure:
    insert image description here
  2. Click the "Advanced" option:
    insert image description here
  3. Click the "Change (C)" option: select a user or group, enter the current computer user name in the box, click Check Name, Confirm, Apply.
    insert image description here
  4. Open the properties window again, edit the corresponding permissions and compile again:
    insert image description here
    insert image description here
  5. After editing and modifying, rebuild the project, and then you can run the project successfully.
    insert image description here

Guess you like

Origin blog.csdn.net/tracydragonlxy/article/details/120724886