React Native Android adbExe不存在 [英] React Native android adbExe does not exist
问题描述
当我使用可视代码运行反应本地android 应用时,出现此错误.我需要帮助来解决此问题.谢谢.
While i run react native android app in visual code i get this error. I need help to resolve this issue. Thanks.
失败:构建失败,发生异常.
出了什么问题:发现任务':app:installDebug'的配置存在问题.
What went wrong: A problem was found with the configuration of task ':app:installDebug'.
为属性"adbExe"指定的文件"C:\ Users \ Supun \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe"不存在.
File 'C:\Users\Supun\AppData\Local\Android\Sdk\platform-tools\adb.exe' specified for property 'adbExe' does not exist.
尝试:使用--stacktrace选项运行以获取堆栈跟踪.使用--info或--debug选项运行,以获取更多日志输出.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
在4分34秒内失败26个可执行任务:26个已执行无法在设备上安装该应用,请阅读上面的错误以获取详细信息.确保您正在运行Android模拟器或已连接设备,并确保设置您的Android开发环境:
BUILD FAILED in 4m 34s 26 actionable tasks: 26 executed 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
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
推荐答案
我知道这是一个老话题,但是如果有人遇到相同问题,我会在此处发布.
I know this is an old topic, but I'll post it here in case if anyone is having the same issue.
对我来说,这通常发生在使用 WSL 且Android SDK安装在Windows(您有 adb.exe
而不是 adb
).
For me, this usually happens when WSL is being used, while Android SDK is installed under Windows (there you have adb.exe
instead of adb
).
制作另一个 adb.exe
二进制文件副本为 adb
为我解决了该问题:
Making another copy of adb.exe
binary as adb
resolved the issue for me:
copy adb.exe adb
这篇关于React Native Android adbExe不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!