I\'m trying to run the command ionic build android --release
to build the apk but i am getting this error
Total time: 1.767 secs Error:
I solved it by installing the Android SDK Platform 24 without the Android SDK manager.
android update sdk --no-ui --filter build-tools-24.0.2,android-24,extra-android-m2repository
*Cordova CLI 6.4.0 / Windows 10
Above peter wang's answer worked for me after setting the ANDROID_HOME environment variable.
in my case ANDROID_HOME
was C:\Users\YourUserName\AppData\Local\Android\android-sdk
After that below commands resulted in a successful build.
mkdir "%ANDROID_HOME%\licenses"
echo |set /p="8933bad161af4178b1185d1a37fbf41ea5269c55" > "%ANDROID_HOME%\licenses\android-sdk-license"
I solved the problem by checking file android-sdk-licenses in Installed ANdroid path for ex my path G:\Android\sdk\licenses with the same file present in this directory C:\Users\Ashutosh\AppData\Local\Android\Sdk\licenses copy all the licenses if more than one :)
You will run into an issue like this whenever your Android Studio's packages are outdated, as building will occur in the latest stable releases. To fix, do the following:
Android Studio > Preferences > Appearance & Behavior > System Settings > Android SDK Tick the latest Android versions (or what you need), click Apply. It's at this point where Android will ask you to agree to its license(s) and the updated version(s) will be installed.
Now you can Ionic / Cordova / PhoneGap build / run.
In Command Prompt, go to ANDROID_HOME\tools\bin
Then run the command, sdkmanager --licenses
Accept the licenses you want when it is prompted.
C:\Users\<UserName>\AppData\Local\Android\Sdk\tools\bin
./sdkmanager.bat --licenses
Worked for me