0

I'm relatively new to ubuntu and I'm currently working in an ionic project. When I give this command sudo ionic cordova build android , it fails. Below is the log

> cordova build android
Android Studio project detected

ANDROID_HOME=/usr/lib/android-sdk
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
Reading build config file: /home/tel/Desktop/AnimalTrackerApp/UserApplication/build.json

            studio
            (node:6766) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Could not find an installed version of Gradle either in Android Studio,
            or on your system to install the gradle wrapper. Please include gradle 
            in your path, or install Android Studio

            [10:57:23]  lint finished in 2.01 s 

But the thing is I have already set my gradle path but it shows this strange error.

gradle -v

    ------------------------------------------------------------
    Gradle 4.6
    ------------------------------------------------------------

    Build time:   2018-02-28 13:36:36 UTC
    Revision:     8fa6ce7945b640e6168488e4417f9bb96e4ab46c

    Groovy:       2.4.12
    Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
    JVM:          1.8.0_162 (Oracle Corporation 25.162-b12)
    OS:           Linux 4.4.0-116-generic amd64

path for gradle: /home/tel/.sdkman/candidates/gradle/current

Why is this error coming ? Please help me out.

Suraj Rao
  • 29,388
  • 11
  • 94
  • 103

0 Answers0