Issue
Can someone show how to solve this issue associated with
ionic cordova build android
I have tried suggestions provided in this link but the issue remain as it is.
cordova.cmd build android Checking Java JDK and Android SDK versions ANDROID_SDK_ROOT=undefined (recommended setting) ANDROID_HOME=undefined (DEPRECATED) Failed to find 'JAVA_HOME' environment variable. Try setting it manually. [ERROR] An error occurred while running subprocess cordova.
cordova.cmd build android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.
Solution
From the error log, it looks like either, you don't have Java installed or don't have it in your environment variable.
Ensure that <path to java>/java/<jdk version>/bin
is in your environment variable. Follow this answer for adding it. https://stackoverflow.com/a/32241360/10602679
Android SDK is required to build Android apps. The recommended way to download it is through Android Studio else you need to download sdk manually
Next, you need to add the Android sdk path in your Environment variable to access the command-line utility. Follow the screenshots provided in this answer for the same. https://stackoverflow.com/a/30900424/10602679
Answered By - Pankaj Sati
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.