I am working on an Ionic 5 project. I have installed Android Studio Bumblebee, but when I run ionic cordova run android
, I get below error. To my understanding, Gradle is automatically installed when I install the Android Studio. Do I need to install Gradle additionally?
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=undefined (DEPRECATED)
Using Android SDK: C:Userswdwb_AppDataLocalAndroidsdk
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
3
Answers
Please have a look at the documentation. You might need to install Gradle according to your OS.
I fixed it by installing gradle like this (mac): brew install gradle
add
{gradle_path}/bin
to environment variable on windows.if you dont have gradle so go to https://gradle.org/install/ Then follow the "Installing manually" section.
Download gradle, which will be in zip file
Create a folder called Gradle
Extract gradle.zip into Gradle folder.
In System variable part, click on ‘path’ => click ‘edit’ => then add