0

When i run 'react-native run-android' i get the following problem:

Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Cannot create service of type TaskExecuter using ProjectExecutionServices.createTaskExecuter() as there is a problem with parameter #21 of type ReservedFileSystemLocationRegistry.
> Cannot create service of type ReservedFileSystemLocationRegistry using ProjectExecutionServices.createReservedFileLocationRegistry() as there is a problem with parameter #1 of type List<ReservedFileSystemLocation>.

Im using linux as my OS.

5 Answers 5

2

I met this. Finally I found that I have installed app in the phone. I solved the problem when i have uninstalled the app and run with different port like:

Before Uninstall

  1. The emulator is running press CMD + m (Mac) or CTRL + m (Windows). Select Dev Settings and then Debug server host & port for device. Enter the url with the new port(9988).
  2. CMD + R or CTRL + R and the application should reload with the new bundle.
  3. uninstalled app
  4. Run app with this command such as: react-native start --port 9988
Sign up to request clarification or add additional context in comments.

Comments

1

You might have the same app installed in the device. Try deleting the apps with same package name, clear the build folder and then re run again.

Comments

1

I had the same error message. I went to Android studio where I got this error:
Cannot lock execution history cache
After searching online i found i had to delete the .lock files in ./gradle. This failed because it was being used by "Open JDK". So I went to task manager and ended the task. After that I could run my app again.

Comments

1

This happens because the gradle task is running and you will need to terminate that process.

Stopping the gradle task using the below command worked for me.

./gradlew --stop

1 Comment

it solved my problem, thank you
0

I have fixed that problem.

Following are the steps taken to fix the issue:

  • Create a new project.
  • Copy code from your old project to the new one.
  • Try to build it again.

It worked for me.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.