I can’t run react-native run-android

androidemulator

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.

Best Answer

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
Related Question