"You may not have the required environment or OS to build this app"

Hey guys,
I so badly need your help.

I have the latest version of java, ant, nodejs and android studio installed. I have followed the step by step instructions I found at the ionic webpage (http://learn.ionicframework.com/videos/windows-android/) and when I get to the point of running the “ionic build android command”, It executes up to a point then gives the error described in the title above. I’ve attached screenshots of my command prompt. Any form of help would be appreciated. Thanks a lot.

I’ve also set my JAVA_HOME, ANT_HOME, ANDROID_HOME, PATH variables correctly.

PS: I’m running Windows 8.1 64bit

Link to command prompt images – http://1drv.ms/1EkK4NA

Please, take the time to go through the images and help me resolve the images. I’m losing my mind and I really cant wait to get started with the Ionic framework…

THanks a lot.

2: Download Apache Ant

              Apache Ant is needed by Android and Cordova for building projects.
              
              Download and extract this zip file somewhere on your computer: http://mirror.tcpdiag.net/apache//ant/binaries/apache-ant-1.9.4-bin.zip
              
              Add the full path to the bin/ folder to the end of your PATH environment variable.

Thanks for your time. Already did this. But still getting the same errors

Not sure if it will help at all, but try to go in platforms /android and launch ant debug (using the CLI). Then go back and try Ionic build -d android

I had this error when i installed Crosswalk for Ionic. What i had to do was open the Android SDK manager and download the latest API (i think its API 21?) and it worked like a charm. So now i have API 19 and 21 intalled, and no longer getting this error. Hope it helps :smile:

Are you using Crosswalk?

No, I’m not using Crosswalk

Hello guys.
I finally got it working. All i did was change the directory where I was creating the Ionic project.
My path variables and sdk were working fine.

Thanks a lot to you guys for your awesome community support. I truly appreciate it.

So, to fix it you simply changed the directory of your whole project? Seems so simple. Any ideas why this happened?
Thanks :wink:

Yeah. I installed Ionic and cordova normally as per the instructions
But the problem was when I created the project in the system32 directory which I think is where Ionic and cordova are installed.

As soon as I created another directory and followed the normal instructions, I was able to build without any errors at all. Worked like a charm.

Are you having any problems with your installation?

I had a error like this before, but as i said, i fixed it by adding another api version of android… Well, anyways, i am glad you got it working, congrats

I am currently having this vexing problem. Still reading up on it without really grasping what the cause might be. I did upgrade the SDK though I suspect I that might have something to do with it.

I was facing the same issue, but fixed the issue by installed Android5.0.1(Api21) through sdk manager.

Changing the directory worked for me as well! cheers!

me having same issues. for me i guess environment variable and path is correct. what exactly have u done??pls help…currently my project is in my desktop

any one help me

i didn’t get how can i get remedy for follow error :smile:

C:\Users\sudhir\RewardsWebApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\sudhir\RewardsWebApp\pl
atforms\android\gradlew cdvBuildRelease -b C:\Users\sudhir\RewardsWebApp\platfor
ms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\sudhir\AppData\Roaming\npm\node_modules\c
ordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

Hi victorolowe could you help me…please

i got error while creating release apk i know you already did get this error and u already get remedy for this error.now what i should do…

C:\Users\sudhir\RewardsWebApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "C:\Users\sudhir\RewardsWebApp\pl
atforms\android\gradlew cdvBuildRelease -b C:\Users\sudhir\RewardsWebApp\platfor
ms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1

You may not have the required environment or OS to build this project
Error: cmd: Command failed with exit code 1
at ChildProcess.whenDone (C:\Users\sudhir\AppData\Roaming\npm\node_modules\c
ordova\node_modules\cordova-lib\src\cordova\superspawn.js:139:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)

I solved this by upgrading cordova globally via sudo npm install -g cordova.

Install android SDK and set path of it to an environment ,
if you are building android app…

Hi I am new for ionic and cordova ,I am facing same problem can anybody help me:

I already installed android sdk and set environment variable also.Please help me