I can't run react-native run-android

1

I'd try to run react-native run-android but it always fails and appears error like this:

JS server already running. Building and installing the app on the device (cd android && ./gradlew installDebug)...

FAILURE: Build failed with an exception.

  • What went wrong: Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().

    Could not create service of type PluginResolutionStrategyInternal using BuildScopeServices.createPluginResolutionStrategy().

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

  • Get more help at https://help.gradle.org

BUILD FAILED in 0s Could not install the app on the device, read the error above for details. Make sure you have an Android emulator running or a device connected and have set up your Android development environment: https://facebook.github.io/react-native/docs/getting-started.html

Command failed: ./gradlew installDebug

Error: Command failed: ./gradlew installDebug at checkExecSyncError (child_process.js:616:11) at Object.execFileSync (child_process.js:634:13) at runOnAllDevices (/Users/jworotikan/AwesomeProject/node_modules/react-native/local-cli/runAndroid/runAndroid.js:299:19) at buildAndRun (/Users/jworotikan/AwesomeProject/node_modules/react-native/local-cli/runAndroid/runAndroid.js:135:12) at isPackagerRunning.then.result (/Users/jworotikan/AwesomeProject/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12) at process._tickCallback (internal/process/next_tick.js:68:7)

Please Help me, how to solve this. I'm Using Mac and running Android Emulator from Android Studio.

4skm3

Posted 2019-01-28T19:33:36.303

Reputation: 11

You might get a better response to this on our sister site [android.se]. – Burgi – 2019-03-11T16:50:33.803

Answers

0

As you're using Mac, then it may be a permission error.

try this on your project using a terminal:

chmod 755 android/gradlew && react-native run-android

Lucas Dolsan

Posted 2019-01-28T19:33:36.303

Reputation: 1

0

  1. Find the process: run:

    ps aux | grep react-native

  2. Kill the process:

    sudo kill -9 14492(pid)

  3. Run project

    react-native run-android or react-native run-ios

Note: Watchman reset cache: If the above steps do not work, please

sudo npm start -- --reset-cache

Jane Alam

Posted 2019-01-28T19:33:36.303

Reputation: 101