'Cannot create service of type TaskExecuter using ProjectExecutionServices

Android Studio 3.6.1 Gradle Version 5.6.4

Gradle Buid Error

Cannot create service of type TaskExecuter using ProjectExecutionServices.createTaskExecuter() as there is a problem with parameter #22 of type ReservedFileSystemLocationRegistry.

Cannot create service of type ReservedFileSystemLocationRegistry using ProjectExecutionServices.createReservedFileLocationRegistry() as there is a problem with parameter #1 of type List<ReservedFileSystemLocation>.


Solution 1:[1]

had same issue, stopping Gradle using the command below fixed it for me:

gradle --stop

or if you are using wrapper, use:

./gradlew --stop

Solution 2:[2]

I simply had to restart my PC for this to get fixed. Unfortunately I didn't try this until after I tried most of the other solutions. ?

Solution 3:[3]

I also had this when I tried building on my ExFAT formatted ssd on macos. Reformatting it using APFS solved it.

Solution 4:[4]

did u face this issue in react native,

  1. go to android folder
  2. open the terminal
  3. if u using vscode terminal(powershell) use -> ./gradlew --stop
  4. otherwise -> gradle --stop

Solution 5:[5]

For me the source of this error was wrong permissions within the project. A sudo chown -R <username> . within the project's root fixed those issues.

Solution 6:[6]

For anyone who has their project on their external drive

  • Try moving it to your local drive

This worked for me

(MacOS Monterey)

Solution 7:[7]

I ran into the same issue when trying to deploy another project on the same virtual device. For me it was solved by selecting "Wipe Data" for that Virtual Device in Android Virtual Device Manager.

Solution 8:[8]

Backing up the answer from Alex. I got this issue when my project is in my external drive. I played around with device permission, file permission and even updated my android studio since I use VS Code for my flutter projects.

Finally made a sample project on android studio and thankfully got the same error message from Gradle. In this way, I knew the issue is not related to the VS code. As Alex said, I wiped the data from android device manager. But I got into some other issue. I let the virtual device to start completely and ran the project again and it worked.

Solution 9:[9]

I had the same issue until I disabled the "Use detected ADB location" under Emulator Extended Controls > Settings. Restarted the emulator and was able to "Run" without any errors occurring anymore. Preview of "Use detected ADB location" setting.

Solution 10:[10]

Creating a new project or performing a clean on any other project except the current one where the error exist solved the problem for me.

Solution 11:[11]

Remove the caches directory under c:\Users<Your user name directory>.gradle directory and do the build again. It worked for me.

Solution 12:[12]

I have faceed same issues in my flutter project for multiple build process and out of memory then I copy project from one folder to another folder and open project from android studio. It's working perfectly.

Solution 13:[13]

In my situation this worked, I'm using Android Studio on Windows 10

  1. I installed JDK and added its installed path into my environment variable under name JAVA_HOME ([follow solution 2][1])
  2. just added --stop run configuration on android/gradlew

[![enter image description here][2]][2] 4. ran android/grandlew

[![enter image description here][3]][3]

  1. remove --stop that you did step 3 and click on okay 6.If not work just restart android studio and follow step 4 again [1]: https://fluttercorner.com/solved-error-java_home-is-not-set-and-no-java-command-could-be-found-in-your-flutter-path-in-flutter/ [2]: https://i.stack.imgur.com/W77DF.png [3]: https://i.stack.imgur.com/T9LWg.png