question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(react-native run-android) -> Error: Command failed: ./gradlew installDebug

See original GitHub issue

I have a problem with runing react-native. When I type react-native run-android it appeare that error !!

Starting JS server...
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:601:13)
    at Object.execFileSync (child_process.js:621:13)
    at runOnAllDevices (/home/moun3im/Downloads/AwesomeProject/node_modules/react-native/local-cli/runAndroid/runAndroid.js:299:19)
    at buildAndRun (/home/moun3im/Downloads/AwesomeProject/node_modules/react-native/local-cli/runAndroid/runAndroid.js:135:12)
    at isPackagerRunning.then.result (/home/moun3im/Downloads/AwesomeProject/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

This is my react environment

  React Native Environment Info:
    System:
      OS: Linux 4.19 Kali GNU/Linux Rolling 2019.1
      CPU: (4) x64 Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
      Memory: 116.45 MB / 5.71 GB
      Shell: 5.0.2 - /bin/bash
    Binaries:
      Node: 8.11.2 - /usr/bin/node
      npm: 5.8.0 - /usr/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.58.3 => 0.58.3 
    npmGlobalPackages:
      react-native-cli: 2.0.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:35
  • Comments:69 (2 by maintainers)

github_iconTop GitHub Comments

92reactions
b3rdaycommented, Feb 6, 2019

I resolve this pb and it works fine 😃 @mounaim-dev @blackinitial After you create your react native app ,try sudo chmod 777 -R to node-modules and ./android also . -react-native run-android works !

30reactions
SergiiNikolayevcommented, Apr 12, 2019

Command failed: ./gradlew installDebug In my case i installed NDK and it solved the problem. Android Studio -> Preferences -> Appearance & Behavior -> System Settings -> Android SDK -> SDK Tools (tab) -> checkbox on NDK -> apply -> OK

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native run-android command failed, but gradlew ...
./gradlew installDebug gave me some errors and fixed it all. Finally build get successed and app is working on Android device. But react-native...
Read more >
Stuck on app:installDebug when running react-native ... - GitHub
i.e c:\folder\app\android; type in gradlew clean; run react-native run-android. that should solve your problem.
Read more >
I can't run react-native run-android - Super User
Building and installing the app on the device (cd android && ./gradlew installDebug)... FAILURE: Build failed with an exception. What went wrong ...
Read more >
Addressing common errors in React Native - LogRocket Blog
Error : Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. ... This error ...
Read more >
command failed: gradlew.bat app:installdebug ... - You.com
when starting my react-native project react-native run-android I get the error in the picture. enter image description here. on the internet cd ./android...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found