android - Apache Cordova Execution failed for task ':compileDebugJavaWithJavac' -
after updates android studio , apache cordova apache cordova project not building.
i new apache cordova, os x , android studio.
in android studio when rebuild project following error in gradle console.
failure: build failed exception. * went wrong: execution failed task ':compiledebugjavawithjavac'. > compilation failed; see compiler error output details. * try: run --stacktrace option stack trace. run --info or --debug option more log output. build failed
in terminal when run command cordova --version
prints out 4.0.0
, which javac
prints out /usr/bin/javac
echo $java_home prints nothing (an empty line).
update: setting path of java_home , android_home in terminal though same errors shown below , after closing terminal java_home , android_home environment variables lost, set them export java_home=/library/java/javavirtualmachines/jdk1.8.0_51.jdk/contents/home
, export android_home=/users/apple/library/android/sdk
when try build project cordova cli not working.
i following errors, if create new project after changing distributionurl in gradle-wrapper.properties , changing buildtoolsversion "19.0.0" "19.1.0" new project worked fine.
please help.
cordova compile command
sreekanth-2:19:02:16 sreekanth$ cordova compile running command: "/users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/cordova/build" buildfile: /users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/build.xml build failed /users/apple/desktop/sreekanth/togetherly daily work/19:/users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/build.xml:7: following error occurred while executing line: java.io.filenotfoundexception: /users/apple/desktop/sreekanth/togetherly daily work/19:/usr/local/cellar/ant/1.9.7/libexec/lib/ant.jar (no such file or directory) @ java.io.randomaccessfile.open0(native method) @ java.io.randomaccessfile.open(randomaccessfile.java:316) @ java.io.randomaccessfile.<init>(randomaccessfile.java:243) @ org.apache.tools.zip.zipfile.<init>(zipfile.java:212) @ org.apache.tools.zip.zipfile.<init>(zipfile.java:177) @ org.apache.tools.ant.helper.projecthelper2.parse(projecthelper2.java:256) @ org.apache.tools.ant.helper.projecthelper2.parseunknownelement(projecthelper2.java:131) @ org.apache.tools.ant.helper.projecthelper2.parseantlibdescriptor(projecthelper2.java:111) @ org.apache.tools.ant.taskdefs.antlib.createantlib(antlib.java:94) @ org.apache.tools.ant.taskdefs.definer.loadantlib(definer.java:425) @ org.apache.tools.ant.taskdefs.definer.execute(definer.java:277) @ org.apache.tools.ant.componenthelper.checknamespace(componenthelper.java:874) @ org.apache.tools.ant.componenthelper.getdefinition(componenthelper.java:307) @ org.apache.tools.ant.componenthelper.createcomponent(componenthelper.java:284) @ org.apache.tools.ant.componenthelper.createcomponent(componenthelper.java:263) @ org.apache.tools.ant.unknownelement.makeobject(unknownelement.java:430) @ org.apache.tools.ant.unknownelement.maybeconfigure(unknownelement.java:164) @ org.apache.tools.ant.task.perform(task.java:347) @ org.apache.tools.ant.target.execute(target.java:435) @ org.apache.tools.ant.helper.projecthelper2.parse(projecthelper2.java:180) @ org.apache.tools.ant.projecthelper.configureproject(projecthelper.java:93) @ org.apache.tools.ant.main.runbuild(main.java:829) @ org.apache.tools.ant.main.startant(main.java:236) @ org.apache.tools.ant.launch.launcher.run(launcher.java:285) @ org.apache.tools.ant.launch.launcher.main(launcher.java:112) total time: 0 seconds /users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ error code 1 command: ant args: debug,-f,/users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/build.xml,-dout.dir=ant-build,-dgen.absolute.dir=ant-gen error: /users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/cordova/build: command failed exit code 1 @ childprocess.whendone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) @ childprocess.emit (events.js:110:17) @ maybeclose (child_process.js:1015:16) @ process.childprocess._handle.onexit (child_process.js:1087:5)
cordova build command
sreekanth-2:19:02:16 sreekanth$ cordova build running command: "/users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/cordova/build" buildfile: /users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/build.xml build failed /users/apple/desktop/sreekanth/togetherly daily work/19:/users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/build.xml:7: following error occurred while executing line: java.io.filenotfoundexception: /users/apple/desktop/sreekanth/togetherly daily work/19:/usr/local/cellar/ant/1.9.7/libexec/lib/ant.jar (no such file or directory) @ java.io.randomaccessfile.open0(native method) @ java.io.randomaccessfile.open(randomaccessfile.java:316) @ java.io.randomaccessfile.<init>(randomaccessfile.java:243) @ org.apache.tools.zip.zipfile.<init>(zipfile.java:212) @ org.apache.tools.zip.zipfile.<init>(zipfile.java:177) @ org.apache.tools.ant.helper.projecthelper2.parse(projecthelper2.java:256) @ org.apache.tools.ant.helper.projecthelper2.parseunknownelement(projecthelper2.java:131) @ org.apache.tools.ant.helper.projecthelper2.parseantlibdescriptor(projecthelper2.java:111) @ org.apache.tools.ant.taskdefs.antlib.createantlib(antlib.java:94) @ org.apache.tools.ant.taskdefs.definer.loadantlib(definer.java:425) @ org.apache.tools.ant.taskdefs.definer.execute(definer.java:277) @ org.apache.tools.ant.componenthelper.checknamespace(componenthelper.java:874) @ org.apache.tools.ant.componenthelper.getdefinition(componenthelper.java:307) @ org.apache.tools.ant.componenthelper.createcomponent(componenthelper.java:284) @ org.apache.tools.ant.componenthelper.createcomponent(componenthelper.java:263) @ org.apache.tools.ant.unknownelement.makeobject(unknownelement.java:430) @ org.apache.tools.ant.unknownelement.maybeconfigure(unknownelement.java:164) @ org.apache.tools.ant.task.perform(task.java:347) @ org.apache.tools.ant.target.execute(target.java:435) @ org.apache.tools.ant.helper.projecthelper2.parse(projecthelper2.java:180) @ org.apache.tools.ant.projecthelper.configureproject(projecthelper.java:93) @ org.apache.tools.ant.main.runbuild(main.java:829) @ org.apache.tools.ant.main.startant(main.java:236) @ org.apache.tools.ant.launch.launcher.run(launcher.java:285) @ org.apache.tools.ant.launch.launcher.main(launcher.java:112) total time: 0 seconds /users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/cordova/node_modules/q/q.js:126 throw e; ^ error code 1 command: ant args: debug,-f,/users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/build.xml,-dout.dir=ant-build,-dgen.absolute.dir=ant-gen error: /users/apple/desktop/sreekanth/togetherly daily work/19:02:16/platforms/android/cordova/build: command failed exit code 1 @ childprocess.whendone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) @ childprocess.emit (events.js:110:17) @ maybeclose (child_process.js:1015:16) @ process.childprocess._handle.onexit (child_process.js:1087:5) sreekanth-2:19:02:16 sreekanth$
type following in terminal
echo "export java_home=/usr/libexec/java_home
"
this print exact export java_home , copy , paste in terminal , press enter.
then try echo $java_home.
Comments
Post a Comment