Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-14008

Cordova Build fails for android in Ubuntu machine

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: cordova-android-7.0.0
    • Fix Version/s: 8.0.0
    • Component/s: cordova-android
    • Labels:
      None
    • Environment:
      • Os: Ubuntu 16.04 LTS
      • node.js : 8.9.4
      • npm: 5.8.0
      • cordova: 8.0.0
      • android: 7.0.0

      Description

      I run the command ``cordova build `` and I get the error:

      ```
      Android Studio project detected
      ANDROID_HOME=/home/keith/Android/Sdk
      JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/
      studio
      Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details
      :wrapper

      BUILD SUCCESSFUL

      Total time: 3.704 secs
      Subproject Path: CordovaLib
      Subproject Path: app

      FAILURE: Build failed with an exception.

      • Try:
        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

      BUILD FAILED in 0s
      (node:11046) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /home/keith/Documents/personal/financeTracker/mobileApp/platforms/android/gradlew: Command failed with exit code 1 Error output:
      FAILURE: Build failed with an exception.

      • Try:
        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

      BUILD FAILED in 0s
      (node:11046) [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.
      ```

       

      I make the change in the ``platforms/android/CordovaLib/build.gradle``

       

      ```

      buildscript {
      repositories {
      jcenter()
      maven

      { // change "https://maven.google.com" url "https://plugins.gradle.org/m2/" }

      }

      dependencies

      { // classpath 'com.android.tools.build:gradle:3.0.1' // change 1.5 to 2.0 classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' }

      }

      ```

      and the build works.

      ```

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                bowserj Joey Robert Bowser
                Reporter:
                Keith3895 Keith Franklin jathanna
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: