【发布时间】:2021-09-03 18:50:04
【问题描述】:
创建构建后显示以下错误消息。
此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 7.0 不兼容。 使用“--warning-mode all”显示各个弃用警告。 见https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings
在 1m 47s 内构建成功 315 个可操作的任务:314 个已执行,1 个是最新的 info 正在连接到开发服务器... 警告无法使用“adb reverse”连接到开发服务器:spawnSync adb ENOENT 信息 启动应用程序... 'adb' 未被识别为内部或外部命令, 可运行的程序或批处理文件。 错误无法启动应用程序。 错误:命令失败:adb shell am start -n com.menpani.laundry_live/com.menpani.laundry_live.MainActivity 在 makeError (D:\rith_laundry\node_modules\execa\index.js:174:9) 在 Function.module.exports.sync (D:\rith_laundry\node_modules\execa\index.js:338:15) 在 tryLaunchAppOnDevice (D:\rith_laundry\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\tryLaunchAppOnDevice.js:58:22) 在 D:\rith_laundry\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:104:39 在 Array.forEach () 在 runOnAllDevices (D:\rith_laundry\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:102:48) 在 processTicksAndRejections (internal/process/task_queues.js:95:5) 在异步 Command.handleAction (D:\rith_laundry\node_modules\react-native\node_modules@react-native-community\cli\build\index.js:186:9) info 使用 --verbose 标志运行 CLI 以获取更多详细信息。
【问题讨论】:
-
您应该提供更多详细信息,而不仅仅是错误声明。但是,从错误语句来看,
'adb' is not recognized as an internal or external command, operable program or batch file.所以adb需要在您的PATH环境变量中的某个位置找到。 -
adb.exe 放在 AppData\Local\Android\Sdk\platform-tools 下
-
使用这些依赖 Android Studio 3.5 SDK Build Tool 31-rc5 SDK Platform tools 31.0.2 Node 14.17.1 JDK 13.0.1
标签: react-native