【发布时间】:2015-09-03 05:26:26
【问题描述】:
我想构建一个 ionic 应用程序,但是当我在终端上运行 ionic build android 时出现以下错误,
Running command: /home/shamil/learn/Ionic/myApp/hooks/after_prepare/010_add_platform_class.js /home/shamil/learn/Ionic/myApp
add to body class: platform-android
Running command: /home/shamil/learn/Ionic/myApp/platforms/android/cordova/build
[Error: 'ANDROID_HOME' environment variable is set to non-existent path: /Android/Sdk
Try update it manually to point to valid SDK directory.]
ERROR building one of the platforms: Error: /home/shamil/learn/Ionic/myApp/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/shamil/learn/Ionic/myApp/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
我已经给出了sdk存在的正确路径,但是为什么会出现这样的错误呢?我已经搜索了足够的东西来解决这个问题,但它仍然给出了同样的错误。
请帮忙。
【问题讨论】:
-
查看此链接如何在 Ubuntu 上安装 Ionic 框架 blog.nraboy.com/2014/09/…