{"action":"created","issue":{"url":"https://api.github.com/repos/driftyco/ionic-cli/issues/431","labels_url":"https://api.github.com/repos/driftyco/ionic-cli/issues/431/labels{/name}","comments_url":"https://api.github.com/repos/driftyco/ionic-cli/issues/431/comments","events_url":"https://api.github.com/repos/driftyco/ionic-cli/issues/431/events","html_url":"https://github.com/driftyco/ionic-cli/issues/431","id":78709141,"number":431,"title":"bug: Error runing ionic build for crosswalk ","user":{"login":"perrygovier","id":571056,"avatar_url":"https://avatars.githubusercontent.com/u/571056?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygovier","html_url":"https://github.com/perrygovier","followers_url":"https://api.github.com/users/perrygovier/followers","following_url":"https://api.github.com/users/perrygovier/following{/other_user}","gists_url":"https://api.github.com/users/perrygovier/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygovier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygovier/subscriptions","organizations_url":"https://api.github.com/users/perrygovier/orgs","repos_url":"https://api.github.com/users/perrygovier/repos","events_url":"https://api.github.com/users/perrygovier/events{/privacy}","received_events_url":"https://api.github.com/users/perrygovier/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-20T21:41:15Z","updated_at":"2015-05-24T13:43:15Z","closed_at":null,"body":"_From @jacargentina on April 28, 2015 13:35_\n\n**Type**: <span ionic-type>bug</span>\n\n**Platform**: <span ionic-platform>desktop</span>  <span ionic-webview>browser</span>\n\n<span ionic-description>I've added crosswalk browser to my project, and when i try to build i get this.\n\n````\nionic build\nrunning cordova build\nRunning command: /home/my_user/javascript/mobile-ionic/hooks/after_prepare/010_add_platform_class.js /home/my_user/javascript/mobile-ionic\nRunning command: /home/my_user/javascript/mobile-ionic/platforms/android/cordova/build \nANDROID_HOME=/opt/android-sdk-linux\nJAVA_HOME=/usr/java/jdk1.8.0_05/\nRunning: /home/my_user/javascript/mobile-ionic/platforms/android/gradlew cdvBuildDebug -b /home/my_user/javascript/mobile-ionic/platforms/android/build.gradle -Dorg.gradle.daemon=true\n\nFAILURE: Build failed with an exception.\n\n* What went wrong:\nCould not dispatch a message to the daemon.\n\n* Try:\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\n\n/home/my_user/javascript/mobile-ionic/platforms/android/cordova/node_modules/q/q.js:126\n                    throw e;\n                          ^\nError code 1 for command: /home/my_user/javascript/mobile-ionic/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/my_user/javascript/mobile-ionic/platforms/android/build.gradle,-Dorg.gradle.daemon=true\nERROR building one of the platforms: Error: /home/my_user/javascript/mobile-ionic/platforms/android/cordova/build: Command failed with exit code 8\nYou may not have the required environment or OS to build this project\nError: /home/my_user/javascript/mobile-ionic/platforms/android/cordova/build: Command failed with exit code 8\n    at ChildProcess.whenDone (/usr/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:131:23)\n    at ChildProcess.emit (events.js:98:17)\n    at maybeClose (child_process.js:766:16)\n    at Process.ChildProcess._handle.onexit (child_process.js:833:5)\n````\n\n**But**, if i do \n\n    cordova build android\n\nit first downloaded all the \"gradle\" things, and everything builds just fine.\n\nMaybe its something about \"paths\" when running from inside **ionic build** ?</span>\n\n<span is-issue-template></span>\n\n\n_Copied from original issue: driftyco/ionic#3635_"},"comment":{"url":"https://api.github.com/repos/driftyco/ionic-cli/issues/comments/105017911","html_url":"https://github.com/driftyco/ionic-cli/issues/431#issuecomment-105017911","issue_url":"https://api.github.com/repos/driftyco/ionic-cli/issues/431","id":105017911,"user":{"login":"mankindsoftware","id":1154992,"avatar_url":"https://avatars.githubusercontent.com/u/1154992?v=3","gravatar_id":"","url":"https://api.github.com/users/mankindsoftware","html_url":"https://github.com/mankindsoftware","followers_url":"https://api.github.com/users/mankindsoftware/followers","following_url":"https://api.github.com/users/mankindsoftware/following{/other_user}","gists_url":"https://api.github.com/users/mankindsoftware/gists{/gist_id}","starred_url":"https://api.github.com/users/mankindsoftware/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mankindsoftware/subscriptions","organizations_url":"https://api.github.com/users/mankindsoftware/orgs","repos_url":"https://api.github.com/users/mankindsoftware/repos","events_url":"https://api.github.com/users/mankindsoftware/events{/privacy}","received_events_url":"https://api.github.com/users/mankindsoftware/received_events","type":"User","site_admin":false},"created_at":"2015-05-24T13:43:15Z","updated_at":"2015-05-24T13:43:15Z","body":"### Corrupted \"gradlew.bat\" File\r\nI get a similar error that may pertain to this issue. I found that the \"android/gradlew.bat\" file that is generated after \"ionic run android\" is corrupt, as below:\r\n\r\n``` bat\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n```\r\nRemoving the first 'set JAVA_HOME...' line allows me to continue my workflow.\r\n\r\n``` bat\r\n:findJavaFromJavaHome\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n```\r\n### Ionic Info\r\n\r\n``` bat\r\nCordova CLI: 5.0.0\r\nGulp version:  CLI version 3.8.11\r\nGulp local:\r\nIonic CLI Version: 1.4.3\r\nIonic App Lib Version: 0.0.19\r\nOS: Windows 7 SP1\r\nNode Version: v0.10.35\r\n```\r\n\r\n### Original Error\r\n``` bat\r\nC:\\ionic\\ionC3>ionic build android\r\nUpdated the hooks directory to have execute permissions\r\nRunning command: \"C:\\Program Files\\nodejs\\node.exe\" C:\\ionic\\ionC3\\hooks\\after_prepare\\010_add_platform_class.js C:\\ionic\\ionC3\r\nadd to body class: platform-android\r\nRunning command: C:\\ionic\\ionC3\\platforms\\android\\cordova\\build.bat\r\nANDROID_HOME=C:\\android\\android-sdk\\\r\nJAVA_HOME=C:\\Progra~1\\Java\\jdk1.8.0_45\r\nRunning: C:\\ionic\\ionC3\\platforms\\android\\gradlew cdvBuildDebug -b C:\\ionic\\ionC3\\platforms\\android\\build.gradle -Dorg.gradle.daemon=true\r\n\r\nFAILURE: Build failed with an exception.\r\n\r\n* Where:\r\nBuild file 'C:\\ionic\\ionC3\\platforms\\android\\build.gradle' line: 22\r\n\r\n* What went wrong:\r\nA problem occurred evaluating root project 'android'.\r\n> Failed to apply plugin [id 'android']\r\n   > Plugin with id 'android' not found.\r\n\r\n* Try:\r\nRun with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.\r\n\r\nBUILD FAILED\r\n\r\nTotal time: 3.926 secs\r\n\r\nC:\\ionic\\ionC3\\platforms\\android\\cordova\\node_modules\\q\\q.js:126\r\n                    throw e;\r\n                          ^\r\nError code 1 for command: cmd with args: /s /c \"C:\\ionic\\ionC3\\platforms\\android\\gradlew cdvBuildDebug -b C:\\ionic\\ionC3\\platforms\\android\\build.gradle -Dorg.gr\r\nadle.daemon=true\"\r\nERROR building one of the platforms: Error: C:\\ionic\\ionC3\\platforms\\android\\cordova\\build.bat: Command failed with exit code 8\r\nYou may not have the required environment or OS to build this project\r\nError: C:\\ionic\\ionC3\\platforms\\android\\cordova\\build.bat: Command failed with exit code 8\r\n    at ChildProcess.whenDone (C:\\Users\\Mark\\AppData\\Roaming\\npm\\node_modules\\cordova\\node_modules\\cordova-lib\\src\\cordova\\superspawn.js:131:23)\r\n    at ChildProcess.emit (events.js:98:17)\r\n    at maybeClose (child_process.js:766:16)\r\n    at Process.ChildProcess._handle.onexit (child_process.js:833:5)\r\n```"}}