ionic framework - cordova fails with exit code 2 -
i building ionic/angularjs/phonegap app. new front end development. have package.json , bowser.json. in package.json, after installing packages, run "bower install" install bower dependencies. able run python server in www , see app in chrome. not able run in android emulator. can please guide me?
edit
i realized after posting question ionic ships angular , should use that. don't need bootstrap ionic framework need. need underscore. clean up. don't think of related error.
here error after running "cordova build":
build failed k:\android\sdk\tools\ant\build.xml:932: following error occurred while execu ting line: k:\android\sdk\tools\ant\build.xml:950: java.lang.arrayindexoutofboundsexception : 1 @ com.android.ant.dependencygraph.parsedependencyfile(dependencygraph.j ava:180) @ com.android.ant.dependencygraph.<init>(dependencygraph.java:54) @ com.android.ant.singledependencytask.initdependencies(singledependenc ytask.java:87) @ com.android.ant.aaptexectask.execute(aaptexectask.java:509) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:292) @ sun.reflect.generatedmethodaccessor4.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodacces sorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.jav a:106) @ org.apache.tools.ant.task.perform(task.java:348) @ org.apache.tools.ant.taskdefs.sequential.execute(sequential.java:68) @ com.android.ant.ifelsetask.execute(ifelsetask.java:124) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:292) @ sun.reflect.generatedmethodaccessor4.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodacces sorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.jav a:106) @ org.apache.tools.ant.task.perform(task.java:348) @ org.apache.tools.ant.taskdefs.sequential.execute(sequential.java:68) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:292) @ sun.reflect.generatedmethodaccessor4.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodacces sorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.jav a:106) @ org.apache.tools.ant.task.perform(task.java:348) @ org.apache.tools.ant.taskdefs.macroinstance.execute(macroinstance.jav a:396) @ org.apache.tools.ant.unknownelement.execute(unknownelement.java:292) @ sun.reflect.generatedmethodaccessor4.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodacces sorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:606) @ org.apache.tools.ant.dispatch.dispatchutils.execute(dispatchutils.jav a:106) @ org.apache.tools.ant.task.perform(task.java:348) @ org.apache.tools.ant.target.execute(target.java:435) @ org.apache.tools.ant.target.performtasks(target.java:456) @ org.apache.tools.ant.project.executesortedtargets(project.java:1393) @ org.apache.tools.ant.project.executetarget(project.java:1364) @ org.apache.tools.ant.helper.defaultexecutor.executetargets(defaultexe cutor.java:41) @ org.apache.tools.ant.project.executetargets(project.java:1248) @ org.apache.tools.ant.main.runbuild(main.java:851) @ org.apache.tools.ant.main.startant(main.java:235) @ org.apache.tools.ant.launch.launcher.run(launcher.java:280) @ org.apache.tools.ant.launch.launcher.main(launcher.java:109) total time: 4 seconds error code 1 command: cmd args: /s,/c,ant,debug,-f,k:\tmp\angulartodo\p latforms\android\build.xml,-dout.dir=ant-build,-dgen.absolute.dir=ant-gen error: cmd: command failed exit code 2 @ childprocess.whendone (c:\users\ibm_admin\appdata\roaming\npm\node_module s\cordova\src\superspawn.js:112:23) @ childprocess.eventemitter.emit (events.js:98:17) @ maybeclose (child_process.js:743:16) @ process.childprocess._handle.onexit (child_process.js:810:5)
package.json
{ "name": "ionic-project", "version": "1.0.0", "description": "an ionic project", "dependencies": { "gulp": "^3.5.6", "gulp-sass": "^0.7.1", "gulp-concat": "^2.2.0", "gulp-minify-css": "^0.3.0", "gulp-rename": "^1.2.0", "karma": "~0.10", "protractor": "~0.17.0", "bower": "^1.3.1" }, "scripts": { "postinstall": "bower install" } }
bower.json (i got angularjs seed project)
{ "name": "angular-seed", "description": "a starter project angularjs", "version": "0.0.0", "homepage": "https://github.com/angular/angular-seed", "license": "mit", "private": true, "dependencies": { "angular": "1.2.x", "angular-route": "1.2.x", "angular-loader": "1.2.x", "angular-mocks": "~1.2.15", "bootstrap" : "3.1.1", "underscore" : "1.6.0" } }
@givanse - answered own question, if have platform dependencies(meaning code not want loose in platform/android), clean build, did:
rm -r platforms/android/ant-build rm -r platforms/android/assets
all now. thanks.
Comments
Post a Comment