cordova failed to ganarate apk saying there is somthing occurred configuring project ':CordovaLib'

11,206

Solution 1

Open Android Studio SDK Manager and under 'SDK platforms' tab, select the required Android versions(Ex:Android 8.1(Oreo)) and click OK. If the error keeps repeating, try installing some of the previous Android versions too.

Solution 2

Open Android studio, open Android SDK manager. Accept License of SDK.

Share:
11,206
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    am a beginner at ionic .. and am trying to generate the apk from an ionic project .. but unfortunately it failed to be generated.giving this error

     Android Studio project detected
    

    ANDROID_HOME=C:\Users\abdel ysf\AppData\Local\Android\sdk JAVA_HOME=C:\Program Files\java\jdk1.8.0_151 studio Subproject Path: CordovaLib Subproject Path: app publishNonDefault is deprecated and has no effect anymore. All variants are now published. [18:51:59] lint finished in 15.14 s Checking the license for package Android SDK Platform 26 in C:\Users\abdel ysf\AppData\Local\Android\sdk\licenses Warning: License for package Android SDK Platform 26 not accepted.

    FAILURE: Build failed with an exception.

    • What went wrong: A problem occurred configuring project ':CordovaLib'.

      You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. 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.

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

    BUILD FAILED in 7s (node:23120) UnhandledPromiseRejectionWarning: Error: cmd: Command failed with exit code 1 Error output: FAILURE: Build failed with an exception.

    • What went wrong: A problem occurred configuring project ':CordovaLib'.

      You have not accepted the license agreements of the following SDK components: [Android SDK Platform 26]. 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.

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

    BUILD FAILED in 7s at ChildProcess.whenDone (C:\Users\abdel ysf\Desktop\ionic\HelloWorld\platforms\android\cordova\node_modules\cordova-common\src\superspawn.js:169:23) at emitTwo (events.js:126:13) at ChildProcess.emit (events.js:214:7) at maybeClose (internal/child_process.js:925:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) (node:23120) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:23120) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    the command which i hade used is : ionic cordova build android

  • Admin
    Admin about 6 years
    i have already accepted the license of sdk .. although it keeps showing ms the same error