当前位置:   article > 正文

AndroidStudio启动项目报错error Failed to launch emulator. Reason: No emulators found as an output of `emul

error failed to launch emulator. reason: no emulators found as an output of

错误:

  1. PS E:\project\AccountManage\android> npm run android
  2. > AccountManage@0.0.1 android
  3. > react-native run-android
  4. info A dev server is already running for this project on port 8081.
  5. ϵͳ�Ҳ���ָ����·����
  6. info Launching emulator...
  7. error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
  8. warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
  9. info Installing the app...
  10. > Task :app:installDebug
  11. Installing APK 'app-debug.apk' on 'Medium_Phone_API_31(AVD) - 12' for :app:debug
  12. Installed on 1 device.
  13. BUILD SUCCESSFUL in 6s
  14. 43 actionable tasks: 2 executed, 41 up-to-date
  15. info Connecting to the development server...
  16. warn Failed to connect to development server using "adb reverse": spawnSync C:\Users\ASUS\AppData\Local\Android\platform-tools\adb ENOENT
  17. info Starting the app...
  18. 系统找不到指定的路径。
  19. error Failed to start the app.
  20. Error: Command failed with exit code 1: C:\Users\ASUS\AppData\Local\Android\platform-tools\adb shell am start -n com.accountmanage/com.accountmanage.MainActivity -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
  21. at makeError (E:\project\AccountManage\node_modules\execa\lib\error.js:60:11)
  22. at module.exports.sync (E:\project\AccountManage\node_modules\execa\index.js:194:17)
  23. at tryLaunchAppOnDevice (E:\project\AccountManage\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\tryLaunchAppOnDevice.js:52:22)
  24. at E:\project\AccountManage\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:93:39
  25. at Array.forEach (<anonymous>)
  26. at runOnAllDevices (E:\project\AccountManage\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:88:48)
  27. at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  28. at async Command.handleAction (E:\project\AccountManage\node_modules\@react-native-community\cli\build\index.js:118:9)
  29. info Run CLI with --verbose flag for more details.

解决方法:

        我是因为android sdk的环境变量没配好

1.找到sdk所在位置

2.配置环境变量

        创建新的变量

ANDROID_HOME

 

         添加到path中

%ANDROID_HOME%\tools\bin

%ANDROID_HOME%\tools

%ANDROID_HOME%\emulator

%ANDROID_HOME%\platform-tools

        然后重启下 AndroidStudio 就能启动项目了 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/473588
推荐阅读
相关标签
  

闽ICP备14008679号