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:\Users\wdwb_\AppData\Local\Android\sdk
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
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
IF I build from terminal, works fine, but when I try to build using Android Studio, error showing :
No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Although all build tools already installed in my Android Studio
Screenshots -
I've got a Cordova v10.0.0 project using Cordova Android v9.0.0, I'm experiencing a problem when trying to build the project for Android, I'm getting the following error:
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=/Users/MYUSER/Library/Android/sdk (DEPRECATED)
Failed to instantiate ProjectBuilder builder: Error: Cannot find module 'compare-func'
I've tried removing my Node Modules folder, running a cordova clean android and re-installing with npm install. Not quite sure why I'm getting this error.
I faced the same issue and I installed compare-func npm package (Link) (npm i compare-func) and it worked for me.
I am trying to build an ionic app for Android device with Cordova using the below command from VSCode.
ionic cordova build android --prod --release
But I'm getting this error:
cordova.cmd build android --release
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=undefined (recommended setting)
ANDROID_HOME=C:\Users\tanmay\AppData\Local\Android\sdk (DEPRECATED)
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
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release exited with exit code 1.
I have already installed JDK, Android Studio. I also have setup the environment variable ANDROID_SDK_ROOT with the correct SDK path. But still no luck.
I am using
Android Studio 3.6.1,
Gradle 6.3,
Cordova 8.1,
on Windows 10.
I guess I am somewhere missing the setting the ANDROID_SDK_ROOT but I'm not sure where.
You can check if Java JDK, Android SDK, Gradle are properly installed before building an app.
To do so, you can run the following command :
cordova requirements android --verbose
It will show, what is missing and after that, you may install it if you haven't installed it or you may check for the correct path in the Environment Variables.
If you have an android studio installed, you need not to worry about this error on terminal, as until this error cordova will update your android package in platforms directory.
Open your Android Studio.
Select open existing project and browse to select your /platforms/android folder in
project directory.
It will open in android and will be build success
I had the same error.
I solved it by using Gradle 5.6.3 instead of the newer versions.
For anyone as dumb as I was that also thought you could setup and run a cordova project on android without having java, gradle or android studio installed: Once you installed all those things, delete your cordova project's node_modules, platforms, plugins and www folders and set them up again (i.e. rerun npm i, cordova platform add android, npm run build, etc) before trying to run the cordova project again. In my case I'm trying to run cordova run android which caused the same error that OP's getting.
NOTE: I have zero experience with cordova. I have to get a very specific cordova/webpack template up and running locally, and the advice I'm giving in this answer is what worked for me. YMMV.
I am using the Netbeans IDE with Cordova. When i try to run my application it fails and i get the following error.
Node.js v8.1.3
cordova v7.0.1
Git v2.13.2
os windows