最佳答案
我正在尝试建立一个离子机器人项目,我已经安装了机器人软盘。
我的项目名为 myApp。我已经成功地将 android 平台添加到 myApp 中。但是当我试图建立这个项目时
~/myApp$ sudo ionic build android
结果是
Running command: /home/hari/myApp/hooks/after_prepare/010_add_platform_class.js /home/hari/myApp
add to body class: platform-android
ERROR building one of the platforms: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
You may not have the required environment or OS to build this project
Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
参见 ANDROID _ HOME 和 PATH 变量
echo $ANDROID_HOME
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hari/Android/Sdk
echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/hari/Android/Sdk/tools:/home/hari/Android/Sdk/platform-tools:/usr/local/bin:/opt/gradle/bin
我见过几乎相同类型的关于堆栈溢出的问题,但没有一个对我有用。我的 android-sdk 配置有什么问题吗?我怎样才能建立这个项目?