nemic
nemic

Reputation: 251

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

Upvotes: 25

Views: 50305

Answers (17)

samad shukr
samad shukr

Reputation: 1069

For Flutter Developer I have got the same problem.

cd android

and then run

./gradlew --stop

Upvotes: 2

Hrusikesh
Hrusikesh

Reputation: 661

I have faced the same issue in a react native project like below in the screenshot when I try to run the app in android simulator using yarn android then I followed the below steps to resolve the issue which I got from the above

enter image description here

Step - 1: Go to android folder and delete build folder.

enter image description here

Step - 2: Run the below command like

cd android and ./gradlew --stop

and then you will see a response like Stopping Daemon(s)

enter image description here

Step - 3: Now running cd .. && yarn android successfully launch the app without the above error.

enter image description here

Upvotes: 2

asad saddique
asad saddique

Reputation: 1

run this command on sudo ./gradlew clean

Upvotes: 0

Deni Al Farizi
Deni Al Farizi

Reputation: 2453

in flutter or react-native go to android folder and run this in cmd

gradlew --stop

next

gradlew clean

to rebuild android or simple so you can restart your computer and run your flutter or react-native project again

Upvotes: 6

Chryzl
Chryzl

Reputation: 181

For anyone who has their project on their external drive

  • Try moving it to your local drive

This worked for me

(MacOS Monterey)

Upvotes: 3

Temuujin Dev
Temuujin Dev

Reputation: 921

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.sstatic.net/W77DF.png [3]: https://i.sstatic.net/T9LWg.png

Upvotes: 0

Charith Prasanna
Charith Prasanna

Reputation: 81

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

Upvotes: 4

Faisal Ahmed
Faisal Ahmed

Reputation: 1106

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.

Upvotes: 0

jaredbaszler
jaredbaszler

Reputation: 4829

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

Upvotes: 21

femotizo
femotizo

Reputation: 1415

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

gradle --stop

or if you are using wrapper, use:

./gradlew --stop

Upvotes: 62

Rajesh Sambandam
Rajesh Sambandam

Reputation: 29

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

Upvotes: 0

Abrham Daniel
Abrham Daniel

Reputation: 49

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.

Upvotes: 0

TmsKtel
TmsKtel

Reputation: 371

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

Upvotes: 9

user1169629
user1169629

Reputation: 467

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.

Upvotes: 2

ghastlybespoke4
ghastlybespoke4

Reputation: 1

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.

Upvotes: 0

user5172374
user5172374

Reputation:

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.

Upvotes: 0

Alex
Alex

Reputation: 39

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.

Upvotes: 0

Related Questions