Ionic-app-scripts: [0.0.39] "ionic platform add android" fails

Created on 2 Nov 2016  路  4Comments  路  Source: ionic-team/ionic-app-scripts

Short description of the problem:

'ionic platform add andorid' fails with 2 errors:

```
FAILURE: Build failed with an exception.

What went wrong:
A problem occurred configuring root project 'android'.
You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 24].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.


Failed to install 'cordova-plugin-console':Error: /home/project_dir/platforms/android/gradlew: Command failed with exit code 1
at ChildProcess.whenDone (/home/project_dir/platforms/android/cordova/node_modules/cordova-common/src/superspawn.js:169:23)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:877:16)
at Process.ChildProcess.handle.onexit (internal/childprocess.js:226:5)

Error: /home/project_dir/platforms/android/gradlew: Command failed with exit code 1
```

What behavior are you expecting?

I expect it to add platform and do not throw any errors

Steps to reproduce:

  1. Create new project: ionic start --v2 myApp
  2. Install the latest version of app-scripts: npm install @ionic/app-scripts@latest
  3. Run ionic platform add androoid

Which @ionic/app-scripts version are you using?
Cordova CLI: 6.4.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 2.0.0-rc.1
Ionic CLI Version: 2.1.4
Ionic App Lib Version: 2.1.2
Ionic App Scripts Version: 0.0.39
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS
Node Version: v6.9.1

Most helpful comment

This is issue with cordova latest release with Android 24. So downgrade your cordova from 6.4.0 to 6.0.0 will solve this issue.

npm install -g [email protected]

It is not ionic issue.

All 4 comments

This is issue with cordova latest release with Android 24. So downgrade your cordova from 6.4.0 to 6.0.0 will solve this issue.

npm install -g [email protected]

It is not ionic issue.

Using the Android SDK manager you need to install the SDK Platform for Android 7.0(API 24).

Up to now you have probably been using API 23.

Hello! Thanks for opening an issue with us! As this seems like more of a support question i will urge that you ask this question on our forum. Thanks for using Ionic!

Upgrading Android SDK to platform 24 solved both issues. Please update Ionic documentation by adding it as pre-requisite for RC installation.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgw96 picture jgw96  路  4Comments

peterpeterparker picture peterpeterparker  路  4Comments

hermitdemschoenenleben picture hermitdemschoenenleben  路  3Comments

christofferjjohansen picture christofferjjohansen  路  3Comments

isflo96 picture isflo96  路  3Comments