Issue
I am trying to execute this command
ionic cordova build android --prod --release
and I get the following error :
Build at: 2021-07-06T09:28:20.394Z - Hash: 933d6e73ee2cc923ca07 - Time: 62511ms
> cordova.cmd build android --release
Checking Java JDK and Android SDK versions
ANDROID_SDK_ROOT=C:\Users\daees\AppData\Local\Android\Sdk (recommended setting)
ANDROID_HOME=C:\Users\daees\AppData\Local\Android\Sdk (DEPRECATED)
Failed to run "javac -version", make sure that you have a JDK version 8 installed.
You can get it from the following location:
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Your JAVA_HOME is invalid: "C:\Program Files"\Java\jdk1.8.0_291
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android --release exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
I tried different solution already discussed but none of them worked for me
Although this says my JAVA_HOME is invalid, but I don't think so, I have it installed and I've added it as environment and System variable
What do I do? Please help
Solution
I simply uninstalled all the versions of JDK and then installed V1.8 again and it worked
Answered By - Sadaf Shafi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.