我正在尝试建立一个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配置有问题吗?我如何建立这个项目?
/home/hari/Android/Sdk
(假定是正确的)