I am trying to build an ionic-android project and i have android sdk installed.
The name of my project is myApp.I have successfully added android platform to myApp. But when i tries to build the project
~/myApp$ sudo ionic build android
result is
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.
see the ANDROID_HOME and PATH variable
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
I have seen almost the same kind of questions on stack overflow, but none works for me. Is there anything wrong with my android-sdk configuration? How can i build this project?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…