简体   繁体   中英

ionic cordova build android - build failed with an exception

I'm a beginner and in trouble with Ionic. I want to make an android app using Cordova for my homework. I tried to switch to Android Studio, uninstall-reinstall the Gradle, run the command with the --verbose flag and nothing works. When I type "ionic cordova build android" I got this error:

**FAILURE: Build failed with an exception.**

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Failed to install the following Android SDK packages as some licences have not been accepted.
     platforms;android-29 Android SDK Platform 29
  To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
  Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

  Using Android SDK: C:\Users\Hp\AppData\Local\Android\sdk

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

**BU¦LD FAILED in 1s**
Command failed with exit code 1: C:\Users\Hp\hava\platforms\android\gradlew cdvBuildDebug -b C:\Users\Hp\hava\platforms\android\build.gradle
[ERROR] An error occurred while running subprocess cordova.

        cordova.cmd build android exited with exit code 1.

Have you installed SDKs and AVDs?

This link has an excellent walk thru

Could be u are using wrong java version.....maybe you didn't set up ENV path.....possibly (most likely based on error) you have not download API levels and accepted the licensing agreement which then also means you haven't install an AVD.

That guide should set you straight.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM