0

When I'm doing 'react-native run-android' I'll have the following questions

Scanning folders for symlinks in S:\demoTest\node_modules (40ms) JS server already running. Building and installing the app on the device (cd android && gradlew.bat installDebug)...

Failure: Build failed with an exception.

BUILD FAILED in 2s 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

Build Gradle - Demo Test

Rohit Sharma
  • 1,271
  • 5
  • 19
  • 37
ChengXi
  • 15
  • 2
  • did you update your gradle? – Harrison Jul 31 '18 at 03:00
  • How to update gradle – ChengXi Jul 31 '18 at 03:44
  • 你進Android Studio的 build.gradle如果沒update上面會有一個sync的按鈕.但感覺你有沒link的library之類的.請檢查一下npm並且看一下package.json – Harrison Jul 31 '18 at 03:50
  • @Harrison please do consider writing in English here so that it can help others too . Thats what this community is for `To Help everyone`. – ADM Jul 31 '18 at 03:52
  • 1
    @ADM yes I apologize I simply wanted to make things clear and try to be as helpful as possible lest language barriers occur. Again, I apologize – Harrison Jul 31 '18 at 03:57
  • @Harrison This is mine package.json { "name": "demotest", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.3.1", "react-native": "0.55.4" }, "devDependencies": { "babel-jest": "23.4.2", "babel-preset-react-native": "4.0.0", "jest": "23.4.2", "react-test-renderer": "16.3.1" }, "jest": { "preset": "react-native" } } – ChengXi Jul 31 '18 at 04:01
  • @Harrison My configuration in Android Studio has no problem – ChengXi Jul 31 '18 at 04:06
  • @ChengXi could you add `classpath 'com.android.tools.build:gradle:3.0.1'` to your project level `build.gradle`? – Harrison Jul 31 '18 at 04:10
  • @Harrison Yes, it can be added to Android Studio, but it is the same error in Visual Studio Code. – ChengXi Jul 31 '18 at 04:14
  • Update the gradle=> File→Settings→Build, Execution, Deployment→Build Tools→Gradle→Use default Gradle wrapper (recommended) – Priyanga Manivelan Nov 28 '18 at 08:20
  • For more info: https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio – Priyanga Manivelan Nov 28 '18 at 08:21

0 Answers0