Home > database >  Cordova doesn't see installed Android SDK
Cordova doesn't see installed Android SDK

Time:01-17

When I run cordova requirements my Mac tells me I don't have any android targets installed, yet Android Studio tells me I have.

enter image description here

enter image description here

I have set JAVA_HOME and ANDROID_HOME as below in .bash_profile:

export JAVA_HOME=/usr/libexec/java_home

export ANDROID_HOME=/Users/darrensweeney/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/emulator

Yet when I run cordova requirements I see the following:

enter image description here

Am I missing a step?

I have also tried removing and re-adding the Android platform within Cordova, no difference.

Update:

Android Studio was throwing an error Please select Android SDK which I fixed by syncing with Gradle.

Now cordova requirements shows the following:

enter image description here

How can I make it see that android-30 is installed?

CodePudding user response:

After a couple of hours digging, there's a better way to do this:

Install the android-sdk library:

brew install --cask android-sdk

This then allows you to use the sdkmanager to add any platform:

sdkmanager "platforms;android-30"

  •  Tags:  
  • Related