Install after formatted

I downloaded sdk and I put it on

myuser/downloads/

I unzip it and I open the file “android”, I downloaded the packages and stop.

you can put the folders where you want as long as you set the PATH correct

export ANDROID_HOME=~/myuser/downloads/YOUR-ADT-BUNDLE-FOLDER-NAME/sdk/tools
export PATH=${PATH}:~/myuser/downloads/YOUR-ADT-BUNDLE-FOLDER-NAME/sdk/tools
export PATH=${PATH}:~/myuser/downloads/YOUR-ADT-BUNDLE-FOLDER-NAME/sdk/platform-tools

please replace YOUR-ADT-BUNDLE-FOLDER-NAME with your android folder name

you can verify if it works

echo $PATH (you need to the the correct path)

this is the situation… of my android-sdk-linux folder
I didn’t no action in my cli again… can you said me what I write in my cli?
Sorry but I’m newbie with linux

however I do this I don’t know if is allright…

francesco@francesco-K53BY ~ $ sudo export ANDROID_HOME=~/francesco/Scaricati/android-sdk-linux/tools
[sudo] password for francesco:
sudo: export: command not found
francesco@francesco-K53BY ~ $ export ANDROID_HOME=~/francesco/Scaricati/android-sdk-linux/tools
francesco@francesco-K53BY ~ $ export PATH=${PATH}:~/francesco/Scaricati/android-sdk-linux/tools
francesco@francesco-K53BY ~ $ export PATH=${PATH}:~/francesco/Scaricati/android-sdk-linux/platform-tools
francesco@francesco-K53BY ~ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/francesco/francesco/Scaricati/android-sdk-linux/tools:/home/francesco/francesco/Scaricati/android-sdk-linux/platform-tools
francesco@francesco-K53BY ~ $

looks good, try it again

francesco@francesco-K53BY ~/myapp $ ionic build android
running cordova build android
Running command: /home/francesco/myapp/hooks/after_prepare/010_add_platform_class.js /home/francesco/myapp
Running command: /home/francesco/myapp/platforms/android/cordova/build
[Error: Please install Android target: “android-21”.

Hint: Open the SDK manager by running: /home/francesco/Scaricati/android-sdk-linux/tools/android
You will require:

  1. “SDK Platform” for android-21
  2. "Android SDK Platform-tools (latest)
  3. “Android SDK Build-tools” (latest)]
    ERROR building one of the platforms: Error: /home/francesco/myapp/platforms/android/cordova/build: Command failed with exit code 2
    You may not have the required environment or OS to build this project
    Error: /home/francesco/myapp/platforms/android/cordova/build: Command failed with exit code 2
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:766:16)
    at Process.ChildProcess._handle.onexit (child_process.js:833:5)
    francesco@francesco-K53BY ~/myapp $ android

(Android SDK Manager:3679): GLib-CRITICAL **: Source ID 901 was not found when attempting to remove it

now I open android sdk manager and I install API 21 (I was installed API 22 but ionic required me API 21)

Please install Android target: "android-21"

Please install and report

is it right?

1 Like

again…

francesco@francesco-K53BY ~/myapp $ ionic build android
running cordova build android
Running command: /home/francesco/myapp/hooks/after_prepare/010_add_platform_class.js /home/francesco/myapp
Running command: /home/francesco/myapp/platforms/android/cordova/build
[Error: ANDROID_HOME is not set and “android” command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/francesco/myapp/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/francesco/myapp/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

please give the output for

echo $ANDROID_HOME

I don’t know what I do…
can you enter with teamviewer? so you can see what you want

however
francesco@francesco-K53BY ~ $ echo $ANDROID_HOME

francesco@francesco-K53BY ~ $ echo $ANDROID_HOME

francesco@francesco-K53BY ~ $

did you open another terminal?
export has a temporary state.
if you run ionic build android you need to ensure that $PATH has the android sdk inside.

its better to put it into your ~/.bash_profile to persist the $PATH.

nano ~/.bash_profile
add the line export PATH=${PATH}:~/francesco/Scaricati/android-sdk-linux/tools
add line export PATH=${PATH}:~/francesco/Scaricati/android-sdk-linux/platform-tools

please ensure that your path is correct to android sdk

for this moment I return into my internal Hard disk and I use it I managed the partitions and expand it…
I had start to use another hard disk (external) because the space in the older was finished.
So in the new hard disk I had install again linux and the android sdk and the others programs to run ionic…
But temporany its solved…
So now I formatted again the external hard disk and finish the problem :smile:
Thank you so much for your help and you patience.

1 Like