无法在设备上应用更改:emulator-5554。错误是:命令 gradlew.bat 失败,退出代码为 1

时间:2021-03-03 18:06:54

标签: android-studio nativescript

我使用 NativeScript 开始了新项目,但经过越来越多的尝试,我无法修复我的错误。

在构建我的应用程序之后:

tns run android --device Pixel_4_API_30

我有这个错误:

Unable to apply changes on device: emulator-5554. Error is: Command gradlew.bat failed with exit code 1.**

..................................... ……………………………………………………………………………………………………………… >

我的跟踪日志:

#############################################################################
   WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING

   Debug level logging will leak security sensitive information!

   https://docs.gradle.org/6.4/userguide/logging.html#sec:debug_security
#############################################################################

Command gradlew.bat failed with exit code 1
Will send the following information to Google Analytics: {
  type: 'googleAnalyticsData',
  category: 'CLI',
  googleAnalyticsDataType: 'event',
  action: 'Performance',
  label: 'AndroidProjectService__buildProject',
  customDimensions: { cd2: 'Angular', cd9: 'false', cd5: 'CLI' },
  value: 3529
}
Error: Command gradlew.bat failed with exit code 1
    at Errors.failWithOptions (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\common\errors.js:157:27)
    at Errors.fail (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\common\errors.js:130:21)
    at GradleCommandService.<anonymous> (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\services\android\gradle-command-service.js:40:30)
    at Generator.throw (<anonymous>)
    at rejected (C:\Users\BRYAN\AppData\Roaming\nvm\v12.13.0\node_modules\nativescript\lib\services\android\gradle-command-service.js:6:65)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

tns 信息:

√ Getting NativeScript components versions information...
√ Component nativescript has 7.2.0 version and is up to date.
‼ Update available for component @nativescript/core. Your current version is 7.1.4 and the latest available version is 7.3.0.
√ Component @nativescript/ios has 7.2.0 version and is up to date.
√ Component @nativescript/android has 7.0.1 version and is up to date.

1 个答案:

答案 0 :(得分:0)

Gradle 已连接到 Java,因此请检查您安装的版本是 8。如果不是,请获取正确的版本并重试。 ns doctor 是你的朋友!

如果这不起作用,请停止任何与 Java 和模拟器 (android/qemu) 相关的任务/进程,然后重试。

如果失败,请尝试重新启动计算机并再次测试。

相关问题