• Register
0 votes

Problem  :

Currently I am learning Ionic I have recently created the ionic 2 project and also added the diagnostic cordova plugin as below:

ionic plugin add cordova.plugins.diagnostic

npm install --save @ionic-native/diagnostic

and after that added the android platform  as below :

ionic platform add android@latest

Now I am trying to build it with ionic build android console but it gives me below 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

How to fix above error?

8 4 2
2,300 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

I know such errors are really hard to fix for beginners.

If you are windows user then you can follow below procedure to fix it.

At the beginning you need to download the Gradle binary.

After downloading just extract your zip file to 'C:\Gradle' or your preferred folder

Then you need to open the edit environment variable dialog from your start menu > Search

Now click on 'New' under your system variables and then add as below

The Variable Name GRADLE_HOME and Variable Value C:\Gradle\gradle-4.0.1

After that you can choose PATH variable from your system variable list

Then you need to append your gradle path to variable value as follows C:\Gradle\gradle-4.0.1\bin

Now press the win Key+R and type cmd then enter > in the command terminal type gradle -v

If you done the setup correctly then you will see your gradle installation details.

5 2 1
4,980 points

Related questions

0 votes
2 answers 176 views
Problem : I am working on the Ionic project in Ubuntu 16.04 LTS, and now I am preparing for release. So I am running the following command: cordova build --release android But I am facing the following error: Error: Could not find gradle wrapper within Android SDK. Might need to ... .1 · I am having All Android versions from 2.1 (Eclair) to 7.1.1 (Nougat) Does anybody have any clue on this error?
asked Nov 29, 2019 alecxe 7.5k points
0 votes
1 answer 7 views
Problem: Do you have any suggestions about how I can resolve this “Gradle wrapper makes the execution of the build independent of the installed gradle version”?
asked Mar 30 tuhin1 48.9k points
0 votes
1 answer 3 views
Problem: As I mentioned in my previous query, I'm having difficulties with my learning; I've tried searching the web but haven't been able to find adequate information; could you assist me in continuing my project?
asked Mar 30 tuhin1 48.9k points
0 votes
1 answer 8 views
Problem: Any help, URGENT: No installed build tools found. install the android build tools version 19.1.0 or higher.
asked Mar 14 Wafa Abu Yousef 6.1k points
0 votes
1 answer 2.1K views
Problem : I am trying to learn the Android and Ionic. If I run the ionic build android command in the root of the ionic project, I am facing below error: FAILURE: Build failed with an exception. Where: Script '/home/javad/Desktop/javadApp/platforms/android/CordovaLib/cordova. ... Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
asked Feb 18, 2020 mphil 2.3k points
0 votes
1 answer 2.6K views
Problem : I cleaned my whole project by deleting my local directories as following ~/.gradle, ~/.m2 ~./android and ~/workspace/project/.gradle and choosing the File -> Invalidate Caches / Restart... in my Android Studio. Now execution of my command ./gradlew leads to the ... say that I deleted too much code, the question now is how can it be repaired again? Do you have any solution to fix this?
asked Jan 18, 2020 jwilliam 3.9k points
0 votes
1 answer 74 views
Problem: I have already cloned my old project and then executed npm install and after that I also run ionic serve But unfortunately I came across below ionic error: [ERROR] @ionic/app-scripts is required for ionic serve to work properly. Looks like @ionic/app-scripts isn't installed in this project. This package is required for ionic serve in ionic/angular 4 projects.
asked Aug 6, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 99 views
Problem: After installing Android Studio 3.2 on my machine I was unable to run Java. I have already tried following jdk-8u181-windows-x64, jdk-10.0.2_windows-x64_bin, jdk-11_windows-x64_bin setting the PATH and also reinstalling everything many times still the result is the ... playing with it too much I think something went very wrong.So I decided to start from fresh and still unable to fix it.
asked Aug 31, 2020 Raphael Pacheco 4.9k points
0 votes
1 answer 2 views
Problem: Need help for this,"gradle dsl method not found: 'android()'."
asked 4 days ago sumaiya simi 15.8k points
0 votes
1 answer 76 views
Problem: I am at the moment facing below error in my android studio after importing my Project: Error:(16, 0) Gradle DSL method not found: 'android()' Possible causes: The project 'LoginActivity' may be using a version of Gradle that does not contain the method. ... fuctionality (eg: editing, debugging) will not work properly. Please guide me to get rid of the above problem as soon as possible.
asked Sep 1, 2020 Raphael Pacheco 4.9k points