我正在尝试构建一个 ionic-android 项目,并且我安装了 android sdk。
我的项目名称是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 配置有什么问题吗?我该如何构建这个项目?
原文由 Hari Krishnan 发布,翻译遵循 CC BY-SA 4.0 许可协议
您可能想确认您的开发环境已正确设置。
引用 spring.io :