0

I get the following error when I run this command

 react-native run-android

Configure project :react-native-onesignal WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html WARNING: Configuration 'testCompile' is obsolete and has been replaced with 'testImplementation'. It will be removed soon. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html

Configure project :react-native-webview :react-native-webview:reactNativeAndroidRoot C:\Users\VO\Desktop\xxxx\xxxx\node_modules\react-native\android

FAILURE: Build failed with an exception.

  • What went wrong: Task installDebug' not found in project ':app'.

  • Try: Run gradlew tasks to get a list of available tasks. 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 4s error 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 error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.

Alwaysblue
  • 9,948
  • 38
  • 121
  • 210
Enes Can Işık
  • 35
  • 1
  • 2
  • 11
  • 1. For Android, you need to manually start the emulator, Have you done that? 2. Go through this question: https://stackoverflow.com/questions/39119301/installdebug-not-found-in-root-project-android-react-native – Alwaysblue Oct 16 '19 at 09:36
  • @iRohitBhatia I tried but I couldn't. I try react-native run-android --variant [projectName] – Enes Can Işık Oct 16 '19 at 10:04
  • You couldn't start emulator? – Alwaysblue Oct 16 '19 at 11:01
  • unfortunately does not open. Can you connect with teamviewer? – Enes Can Işık Oct 16 '19 at 11:09
  • sorry, I can't connect with team viewer but in mac (which I use) for android you need to manually start Android and then do react-native run-android. https://facebook.github.io/react-native/docs/getting-started – Alwaysblue Oct 16 '19 at 11:13
  • I tried but I got this error this time. Note: Recompile with -Xlint:deprecation for details. 1 error 3 warnings FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-facebook-account-kit:compileDebugJavaWithJavac'. > Compilation failed; see the compiler error output for details. – Enes Can Işık Oct 16 '19 at 11:43

1 Answers1

0

First check these:

  1. Check that you have installed all your dependencies correctly or not.
  2. react-native-webview and other plugins giving error then try to fix it.
  3. Gradle version are important for specific plugin usage so check it also that you are using supported Gradle version.

Follow these steps:

  1. Close all metro bundles

  2. watchman watch-del-all && rm -rf node_modules/ && npm cache clean && npm install && npm start -- --reset-cache

  3. open Android Studio and open yourprojectname/android

  4. Let Android Studio sync and if there any sync issue then fix it.

  5. Go to File menu -> invalidate cache and restart

  6. Before react-native run-android try to check you have open device or emulator

  7. Check it with adb devices

  8. Now try once.

Prashen
  • 101
  • 8
  • I think that the project info is less for solving your issue. Give us some information to solve this: - react-native info (with this we all know everything is installed correctly) - provide your package.json code here - provide screenshot of the issue when you are trying react-native run-android - Tell us when you were last able to run the app and when it breaks? – Prashen Oct 17 '19 at 06:41