1
I am beginner in mobile development and was studying IONIC, when I went to try to generate the test project apk gave the following error:
WARN: Ionic.project has been renamed to Ionic.config.json, Please Rename it. Running command: /home/lupum/Documents/testeionic/Hooks/after_prepare/010_add_platform_class.js /home/lupum/Documents/testeionic
add to body class: Platform-android
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.
I executed the command:
sudo ionic build android
And before that:
sudo cordova platform add android
I’ve been looking for ways to solve and found some that talked to change the PATH where I found ANDROID.
I executed the following commands:
export ANDROID_HOME=/</usr/local/android-studio/>/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
For my android found in: /usr/local/android-studio/
And the android platform on: ~/Android/Sdk/platform-tools$
Through this article: https://stackoverflow.com/questions/36198165/failed-to-find-android-home-environment-variable
The problem persists.
I would appreciate your help.
Hello guys these are my directories, as it would be the correct way to set in the path ?
When I run the above commands it gives this error: WARN: Ionic.project has been renamed to Ionic.config.json, Please Rename it. Running command: /home/lupum/Documents/DOGIT/IONIC/Ionic-Bitcoins-master/Hooks/after_prepare/010_add_platform_class.js /home/lupum/Documents/DOGIT/IONIC/Ionic-Bitcoins-master add to body class: Platform-android Error: 'ANDROID_HOME' Environment variable is set to non-existent path: /usr/local/android-studio/android-sdk-linux Try update it Manually to point to Valid SDK directory.
– CRISLANIO
Also I’ve gotten the update of Android SDK plus speaks that it is already in fact the newest version. So the error is another, also not permission believe.
– CRISLANIO
@CRISLANIO I edited the answer, read again please.
– Guilherme Nascimento