首页 > 解决方案 > Problem runing 'react-native run-android'

问题描述

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.

标签: androidreact-native

解决方案


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

推荐阅读