【问题标题】:Ionic app build issue离子应用程序构建问题
【发布时间】:2023-03-12 22:23:01
【问题描述】:

我是离子新手。我开发了示例应用程序离子。 当我尝试执行下面的命令时,它给出了 gradle 错误。

$ ionic build android

以下是构建错误:

Error: /home/myapp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred starting process 'Gradle build daemon'

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

Gradle 版本是 3.3

【问题讨论】:

  • 看来java编译器有问题。你有没有安装java,jre和jdk?
  • 使用--stacktrace 选项运行构建命令将了解问题
  • @mnemosdev,是的,我已经安装了 java 1.8
  • @suraj,我试过 --stacktrace 但它给出了同样的错误。
  • 没有其他信息?试试 --debug

标签: android gradle ionic-framework ionic2 gradlew


【解决方案1】:

Android SDK 和 Android Studio 位于 /usr/local/ 文件夹

您要么必须将其移动到您的主目录(这涉及重新安装)。

或者使用 sudo 运行 ionic build 命令

sudo ionic build android

可以在技术上更改特定 sdk 和 studio 文件夹的权限,但不建议尤其是在 /usr 目录中。

【讨论】:

  • 将 Android SDK 和 Android Studio 移至主目录。它给出了同样的错误。
  • ANDROID_HOME=/home/Android/android-sdk-linux/
  • 你用 sudo 试过了吗?
  • 这个stackoverflow.com/questions/20471311/…是android studio但可能适用。
猜你喜欢
  • 1970-01-01
  • 2020-05-15
  • 1970-01-01
  • 1970-01-01
  • 2015-01-14
  • 2019-10-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多