I am new to android, cordova and ionic. I have created a simple ionic hybrid application and trying to build to android platform and it gives the following error
"grunt cordova" from the application directory is giving "Warning: Task "cordova" not found, Use --force to continue. Aborted due to warnings.
When I tried "cordova platform add android" it is giving Error: command failed with exit code ENOENT
Please help me to get this solved.
Following is my system and software details, and also included some diagnostics
Operating System: Windows 8, 64-bit
Installable • Java: jdk1.8.0.31, 64-bit • Ant: apache-ant-1.9.4 • Android SDK: android-sdk_r24.0.2-windows, 64-bt • Cordova: 4.2.0 PATH Environment Variable • Java : C:\Program Files\Java\jdk1.8.0_31\bin • Ant: C:\Program Files\apache-ant-1.9.4\bin • Android ○ Tools: C:\Program Files\Android\tools ○ Platform-tools: C:\Program Files\Android\platform-tools ○ Build Tools: C:\Program Files\Android • npm: C:\Users\<>\AppData\Roaming\npm
HOME Environment variables • JAVA_HOME: C:\Program Files\Java\jdk1.8.0_31 • ANT_HOME: C:\Program Files\apache-ant-1.9.4 • ANDROID_HOME: C:\Program Files\Android Grunt Version - grunt-cli v0.1.13, grunt v0.4.5
Diagnostics 1) c:\IonicTut\firstProject>grunt cordova Warning: Task "cordova" not found. Use --force to continue Aborted due to warnings
2) c:\IonicTut\firstProject>cordova platform add android Error: Command failed with exit code ENOENT at ChildProcess.whenDone ...
3) Then I went to user .cordova and executed check_reqs.bat, it gave the following error, even though android sdk installed and PATH and ANDROID_HOME was set as listed earlier. Error: Please install Android target 19 . Make sure you have the latest Android tools installed as well. Run "android" from your command-line to install/update any missing SDKs or tools.]
4) As instructed in the above message I have tried executing android from the command prompt, then it gave me the following message and saying suitable java not found, I have installed Java SDK and set PATH to JDK bin and JAVA_HOME to JDK folder.
Error: No suitable Java found. In order to properly use the Android Developer Tools, you need a suitable version of Java JDK installed …