Question :

I create ionic 2 project and add diagnostic cordova plugin like this :

ionic plugin add cordova.plugins.diagnostic

npm install --save @ionic-native/diagnostic

and add android platform like this :

ionic platform add android@latest

but when build with ionic build android console give me this error :

Error: 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

and I try to download manualy and change this distributionUrl var in platform/android/cordova/lib/builders/GradleBuilder.js

 var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://'


var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'file:///E:/gradles/';

but not working and console give me last error.

I dont know how to add gradle for android@latest version


Try installing gradle and include it into your path. Click the link below to get manual.