简体   繁体   中英

Execution failed for task ':app:installDebug' react native app

Hi i got this error when i try to run react app on my real android device via: react-native run-android

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all 

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Try these steps.

  1. Delete node modules folder in your project.
  2. Delete build folder in android/build
  3. Close all running terminals.
  4. Make sure you have installed adb drivers in your environment. If not install adb drivers. ( For macOS / For Windows )
  5. Open new terminal window and in your project folder run npm install to re-install node modules.
  6. Finally run your app using react-native run-android

If you are using Android Studio, make sure you run the emulator before running the commands and the emulator API level matches the targetSdk (build.gradle).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM