Gradle error

while running command in cmd “ionic cordova plugin add cordova-plugin-calendar”

i got error like this

ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Failed to install ‘cordova-plugin-compat’: CordovaError: 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

1 Like

I think install Android Studio solved all Gradle problem.

Hi, @drquochoai

I already installed android studio 5 months ago
so you said that reinstall it?

could you run ionic info and show us results?

Hi, @drquochoai

cli packages: (D:\kdIonic\ejohri\node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 1.3.7
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.4.2

System:

Node : v6.10.3
npm  : 3.10.10
OS   : Windows 7

Misc:

backend : legacy
ionic info

cli packages: (C:\Users\drquochoai\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.1

System:

    Android SDK Tools : 26.0.2
    Node              : v6.11.2
    npm               : 3.10.10
    OS                : Windows 10

Misc:

    backend : legacy

May be you missing Android SDK Tools : 26.0.2, you should have ANDROID_HOME, and ANDROID_SDK_ROOT in your system variable

Hi, @drquochoai

I recently uninstalled Android Studio

now I am trying to download latest Android Studio 2.3.3

once i will install then i will give reply

Hi @cooldp007
I think that is a good solution now.

Hi, @drquochoai

i installed Android Studio but same error occured

ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Failed to install ‘cordova-plugin-compat’: CordovaError: 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

Ionic Info :-

cli packages: (C:\Users\PC\AppData\Roaming\npm\node_modules)

@ionic/cli-utils  : 1.12.0
ionic (Ionic CLI) : 3.12.0

global packages:

cordova (Cordova CLI) : 7.0.1

local packages:

@ionic/app-scripts : 1.3.7
Cordova Platforms  : android 6.2.3
Ionic Framework    : ionic-angular 3.4.2

System:

Android SDK Tools : 26.1.1
Node              : v6.10.3
npm               : 3.10.10
OS                : Windows 7

Misc:

backend : legacy

Try to run

ionic cordova plugin remove cordova-plugin-compat
ionic cordova plugin add cordova-plugin-compat
ionic cordova prepare

Hi, @drquochoai

I did your command

now should i run

ionic cordova build android --prod?

yes @cooldp007 , try it

1 Like

Hi, @drquochoai

Same error occured

ANDROID_HOME=D:\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_131
Failed to install ‘cordova-plugin-compat’: CordovaError: 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

Hi, @drquochoai

I installed gradle in windows and set path variable

and now it’s work fine

Thank you so much for supporting me

Download gradle from this link follows

> https://gradle.org/install/

Then follow the steps in the link below

I did the same thing, yet I still get the error message, could you say exactly what did you do?