【问题标题】:Ionic Fails To build and deploy apk to physical deviceIonic 无法构建和部署 apk 到物理设备
【发布时间】:2018-09-27 08:11:44
【问题描述】:

我正在尝试构建一个我已经使用 ionic 2 在其他设备和计算机上测试过的应用程序。我不断收到此错误,然后构建完成并部署了应用程序,即使它不是。

    (node:11125) UnhandledPromiseRejectionWarning: Error: /Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugAssets'.
> java.io.IOException: Could not delete path '/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates/assets/debug/www/index.html'.

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

* Get more help at https://help.gradle.org

BUILD FAILED in 2s
    at ChildProcess.whenDone (/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
    at emitTwo (events.js:126:13)
    at ChildProcess.emit (events.js:214:7)
    at maybeClose (internal/child_process.js:925:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
(node:11125) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11125) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

[OK] Your app has been deployed.
     Did you know you can live-reload changes from your app with --livereload?

MacOSs-MacBook-Pro:frontendrest kieran$

【问题讨论】:

  • 尝试将/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates/assets/debug/www/index.html添加为空文件并重复
  • 你可以试试cordova run android --verbose吗?

标签: android node.js angular ionic-framework ionic2


【解决方案1】:

有时我也会遇到类似的问题。

  1. 只需删除路径中的 intermediates 文件夹即可:

/Users/kieran/Desktop/finalyearproject/frontendrest/platforms/android/app/build/intermediates

  1. 在任务管理器中终止“java”进程。

【讨论】:

  • 感谢您的回答。这是解决方案
猜你喜欢
  • 2021-09-17
  • 1970-01-01
  • 1970-01-01
  • 2021-07-12
  • 2021-09-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-14
相关资源
最近更新 更多