3

I am doing the following ionic command:

ionic build android

I am receiving this error message:

Hint: Open the SDK manager by running: /usr/local/Cellar/android-sdk/24.3.4/bin/android
You will require:
1. "SDK Platform" for android-24
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)]

So I opened the SDK manager and I see the following info:

I have removed, added, installed, trying to build, etc. But I have had zero luck. I have also tried all of these changes to my files. But still nothing.

I have also tried adding the android_home path to my .bash_profile. I currently do not have it configured. But it didn't work earlier.

Community
  • 1
  • 1
Chris Bolton
  • 2,162
  • 4
  • 36
  • 75

2 Answers2

1

Instruction 1:

After adding your ANDROID_HOME, make sure you do the below:

  1. Restart your System or run source ~/.bash_profile

  2. Remove Android platform from your project ionic cordova platform rm android or ionic platform rm android

  3. Add Android platform ionic cordova platform add android

  4. Then ionic cordova run android or ionic run android

Instruction 2:

To set your ANDROID_HOME and JAVA_HOME, follow the below steps:

  1. Run command open ~/.bash_profile
  2. Paste the below in the file that opens on your Text editor

    export ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1
    export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
    
  3. Save - "Command S" or "Ctrl S"

  4. Then Follow the "Instruction 1:" above

NOTE: Make sure you have 24.4.1_1 SDK

Hope this helps.

Martin Evans
  • 45,791
  • 17
  • 81
  • 97
Victor Ejiogu
  • 1,184
  • 14
  • 23
0

I'm not sure why it mentions android-24, but for me just installing the latest (in this case 23) and updating both project.properties files and the manifest as explained in the SO link you menioned (this answer) worked.

Community
  • 1
  • 1
Dunc
  • 18,404
  • 6
  • 86
  • 103