It is because by default at the time of this writing , Ionic CLI tool is defaulted to
<preference name="android-targetSdkVersion" value="LATEST_SDK_VERSION"/>
That is the reason why it complains that you did not accept license agreement , but in reality you did not install the SDK packages for that API Level yet alone accept the license.
So what you need to do is either
- Change Your target SDK version
- Install latest SDK API level from SDK Manager
Changing your SDK version
You can do it manually and even verify it by running
ionic cordova platform add android
the file can be found at your-awesome-app/config.xml
open it and add this line , since its hidden as stated above
<preference name="android-targetSdkVersion" value="24"/>
If you are not sure which API LEVEL Number you are targeting open SDK Manager and look at the API levels (Numbers) available on your machine
Installing Latest SDK Package
You can add the current SDK Packages which the CLI is showing , Which in your case it is 24
Run SDK MANAGER
as Admin
Install the SDK API Packages which you are targeting
How did I know this?
I did it this morning and that's how I solved it and now am playing Sticky Bubble on Android to relax a bit.
Happy Deploying!
android-sdk
from multiple places (brew
,brew cask
andandroid-studio
) and not calling the appropriatesdkmanager --licenses
command – Pierre-Alexis de Solminihac