-
7 Jan 2013 6:24 PM #11
Thks for your quick answer, that solved my problem, my project is package and I can run it on my browser, but I cant run it on my emulator like the screencast, my android simulator is open. I got this error:
[ERR] C:\Program Files (x86)\Apache Group\Apache2\htdocs\CartMe\build.xml:10: Execute failed: java.io.IOException: Cannot run program "C:\Program Files (x86)\Apache Group\Apache2\htdocs\CartMe\build\CartMe\android\cordova\debug": CreateProcess error=2, The system cannot find the file specified
-
7 Jan 2013 10:38 PM #12
Even closer now. I am assuming that since it couldn't find the cordova debug script that you're using cordova 2.3.0 since this has now changed. Aside from that, you're on windows and since these are bash scripts you wouldn't be able to use them anyway. You can still compile and install to your running emulator using some vanilla ant. Implement the -after-build-android target like so:
and it will work. With the release of cordova 2.3.0, I have a couple of small fixes and features to introduce to the project. I'll be completing those within the next day or two so check back for that.Code:<target name="-after-build-android"> <exec executable="ant"> <arg value="-buildfile" /> <arg value="${cordova.android.project}/build.xml" /> <arg value="debug" /> </exec> <exec executable="adb"> <arg value="install" /> <arg value="-r" /> <arg value="${cordova.android.project}/bin/${app.name}-debug.apk" /> </exec> </target>
BriceBrice Mason
Front End Developer
Modus Create
@bricemason
bricemason.com
Sencha Touch Screencasts
Vimeo - Sencha Touch Channel
Github Projects:
Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.
Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.
Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.
-
8 Jan 2013 11:28 AM #13
-
9 Jan 2013 11:04 PM #14
Hey Everyone,
Sencha Cordova Builder has been updated, here are the details:- Out of the box Windows support. You no longer have to specify the 'create' script or change paths to suit Windows.
- You no longer have to hard-code the cordova javascript libraries. Configuration is now as simple as pointing the config at your phonegap library...that's it
- Tested successfully with cordova 2.0-2.3
https://github.com/bricemason/sencha-cordova-builder
BriceBrice Mason
Front End Developer
Modus Create
@bricemason
bricemason.com
Sencha Touch Screencasts
Vimeo - Sencha Touch Channel
Github Projects:
Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.
Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.
Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.
-
12 Jan 2013 5:38 AM #15
Hey Brice, thanks for this script. I've got the latest version up and running on osx with phonegap 2.3.0 but each time I build my package I get an error:
If I manually create the Android directory the script runs to completion. It successfully creates the ios files which I can open in xcode but the (manually created) android directory only contains an assets/www directory with what appears to be my basic sencha app files.Code:[INF] [echo] project namespace: com.example.cdApp [INF] [echo] project name: cdApp [INF] [exec] An unexpected error occurred: ANDROID_BIN="$'{'ANDROID_BIN:=$( which android )'}'" exited with 1 [INF] [exec] Deleting project... [ERR] [exec] Result: 1 [ERR] BUILD FAILED [ERR] com.sencha.exceptions.BasicException: /Users/gareth/Desktop/cdApp/build/cdApp/android does not exist.
Any idea what I might be doing wrong?
Thanks
Gareth
-
12 Jan 2013 12:22 PM #16
Hi Gareth,
Thanks for trying the project out. I just did another test with phonegap 2.3.0 and it work out good. Could you please post more of your log, specifically the part when the target -is-android-init-ready. Mine looks like this:
You can see there on the second to last line where the android project is created.Code:[INF] -is-android-init-ready: [INF] [echo] checking android initialization using the following resources: [INF] [echo] cordova library /Users/bricemason/lib/phonegap-2.3.0 [INF] [echo] android tools /Users/bricemason/lib/phonegap-2.3.0/lib/android/bin [INF] [echo] android create script /Users/bricemason/lib/phonegap-2.3.0/lib/android/bin/create [INF] [echo] android project /Users/bricemason/Desktop/apps/my-app/build/MyApp/android [INF] [echo] android project built state...false
Also, your log output that you posted seems like it's coming from some other custom source. Where is this coming from?:
[INF] [echo] project namespace: com.example.cdApp[INF] [echo] project name: cdApp
Do you have some other code in your build file that's outputting this?
Does the file cordova-android.js exist in the root of your sencha app?
BriceBrice Mason
Front End Developer
Modus Create
@bricemason
bricemason.com
Sencha Touch Screencasts
Vimeo - Sencha Touch Channel
Github Projects:
Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.
Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.
Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.
-
14 Jan 2013 2:55 AM #17
Hi Brice, my log is below. I've run the script again using the same namespace as in your walkthrough and get the same error. I'm not including any additional code, this is from the default sencha generated app (same as your walkthrough). And no, cordova-android.js does not exist in the root of the sencha app.
Thanks for your help Brice.Code:Gareths-Mac:my-app gareth$ sencha app build package Sencha Cmd v3.0.0.250 [INF] init-properties: [INF] init-sencha-command: [INF] init: [INF] -before-app-build: [INF] app-build-impl: [INF] package: [INF] -before-init-local: [INF] -init-local: [INF] -after-init-local: [INF] init-local: [INF] find-cmd: [INF] -before-init: [INF] -init: [INF] -after-init: [INF] init: [INF] -before-build: [INF] sass: [INF] -before-sass: [INF] -sass: [INF] [shellscript] overwrite ../css/app.css [INF] -after-sass: [INF] page: [INF] -before-page: [INF] -page: [INF] building application [INF] Deploying your application to /Users/gareth/Desktop/apps/my-app/build/myApp/package [INF] Copied app.js [INF] Copied resources/css/app.css [INF] Copied /Users/gareth/Desktop/apps/my-app/resources/icons [INF] Copied /Users/gareth/Desktop/apps/my-app/resources/startup [INF] Resolving your application dependencies (file:////Users/gareth/Desktop/apps/my-app/index.html) [INF] Compiling app.js and dependencies [INF] Processing classPath entry : /Users/gareth/Desktop/apps/my-app/sencha-compile-temp-dir [INF] Processing classPath entry : /Users/gareth/Desktop/apps/my-app/touch/src [INF] Processing classPath entry : /Users/gareth/Desktop/apps/my-app/app.js [INF] Processing classPath entry : /Users/gareth/Desktop/apps/my-app/app [INF] Processing class inheritance graph [INF] Processing instantiation refereces to classes and aliases [INF] Processing source dependencies [INF] Concatenating output to file /Users/gareth/Desktop/apps/my-app/build/myApp/package/app.js [INF] Completed compilation. [INF] Processed remote file touch/sencha-touch.js [INF] Processed local file app.js [INF] Minified app.js [INF] Minified resources/css/app.css [INF] Generated app.json [INF] Embedded microloader into index.html [INF] Successfully deployed your application to /Users/gareth/Desktop/apps/my-app/build/myApp/package [INF] -after-page: [INF] run: [INF] -build: [INF] -check-os: [INF] -make-unix-property-paths: [INF] -make-windows-property-paths: [INF] -init-properties: [INF] -is-android-built: [INF] -set-windows-create-script: [INF] -set-unix-create-script: [INF] -is-android-init-ready: [INF] [echo] checking android initialization using the following resources: [INF] [echo] cordova library /Users/gareth/Desktop/phonegap-2.3.0 [INF] [echo] android tools /Users/gareth/Desktop/phonegap-2.3.0/lib/android/bin [INF] [echo] android create script /Users/gareth/Desktop/phonegap-2.3.0/lib/android/bin/create [INF] [echo] android project /Users/gareth/Desktop/apps/my-app/build/myApp/android [INF] [echo] android project built state...false [INF] -before-init-android-internal: [INF] -before-init-android: [INF] -init-android-internal: [INF] [echo] initializating android build... [INF] [echo] creating android project with the following details: [INF] [echo] project path: /Users/gareth/Desktop/apps/my-app/build/myApp/android [INF] [echo] project namespace: com.example.myApp [INF] [echo] project name: myApp [INF] [exec] An unexpected error occurred: ANDROID_BIN="$'{'ANDROID_BIN:=$( which android )'}'" exited with 1 [INF] [exec] Deleting project... [ERR] [exec] Result: 1 [ERR] BUILD FAILED [ERR] com.sencha.exceptions.BasicException: /Users/gareth/Desktop/apps/my-app/build/myApp/android does not exist. [ERR] at com.sencha.exceptions.BasicException.wrap(BasicException.java:43) [ERR] at com.sencha.cli.Command.dispatch(Command.java:104) [ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49) [ERR] at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182) [ERR] at com.sencha.ant.SenchaCommandTask.doExecute(SenchaCommandTask.java:58) [ERR] at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:22) [ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [ERR] at java.lang.reflect.Method.invoke(Method.java:597) [ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [ERR] at org.apache.tools.ant.Task.perform(Task.java:348) [ERR] at org.apache.tools.ant.Target.execute(Target.java:392) [ERR] at org.apache.tools.ant.Target.performTasks(Target.java:413) [ERR] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) [ERR] at org.apache.tools.ant.Project.executeTarget(Project.java:1368) [ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [ERR] at org.apache.tools.ant.Project.executeTargets(Project.java:1251) [ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:156) [ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:72) [ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:87) [ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:91) [ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCommand.run(BasePluginCommands.java:135) [ERR] at com.sencha.command.app.AppCommands$BuildCommand.execute(AppCommands.java:106) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [ERR] at java.lang.reflect.Method.invoke(Method.java:597) [ERR] at com.sencha.cli.Command.dispatch(Command.java:78) [ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49) [ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49) [ERR] at com.sencha.command.Sencha.main(Sencha.java:71) [ERR] Caused by: /Users/gareth/Desktop/sencha-cordova-builder/build-cordova-android.xml:59: /Users/gareth/Desktop/apps/my-app/build/myApp/android does not exist. [ERR] at org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:483) [ERR] at org.apache.tools.ant.taskdefs.MatchingTask.getDirectoryScanner(MatchingTask.java:192) [ERR] at org.apache.tools.ant.taskdefs.Replace.execute(Replace.java:542) [ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) [ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [ERR] at java.lang.reflect.Method.invoke(Method.java:597) [ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [ERR] at org.apache.tools.ant.Task.perform(Task.java:348) [ERR] at org.apache.tools.ant.Target.execute(Target.java:392) [ERR] at org.apache.tools.ant.Target.performTasks(Target.java:413) [ERR] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) [ERR] at org.apache.tools.ant.Project.executeTarget(Project.java:1368) [ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [ERR] at org.apache.tools.ant.Project.executeTargets(Project.java:1251) [ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:156) [ERR] at com.sencha.ant.AntRunner.run(AntRunner.java:80) [ERR] at com.sencha.command.ant.AntCommand.execute(AntCommand.java:75) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [ERR] at java.lang.reflect.Method.invoke(Method.java:597) [ERR] at com.sencha.cli.Command.dispatch(Command.java:78) [ERR] ... 31 more [ERR] Total time: 27 seconds [ERR] com.sencha.exceptions.BasicException: /Users/gareth/Desktop/apps/my-app/build/myApp/android does not exist. Gareths-Mac:my-app gareth$
-
14 Jan 2013 4:51 AM #18
Hi Gareth,
I apologize for my 'weekend brain' attempting to help you solve your question. I believe the answer or at least the path to the answer was right in front of me.
This part:
is from the PhoneGap create script. It's attempting to get the path to the android program from your path.Code:ANDROID_BIN="$'{'ANDROID_BIN:=$( which android )'}'"
When you run the command:
do you get the absolute path to it? If not, you'll need to add the path to the android developer kit to your PATH variable. The output of this command for me results in:Code:which android
BriceCode:/Users/bricemason/lib/android-sdk-macosx/tools/android
Brice Mason
Front End Developer
Modus Create
@bricemason
bricemason.com
Sencha Touch Screencasts
Vimeo - Sencha Touch Channel
Github Projects:
Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.
Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.
Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.
-
14 Jan 2013 6:56 AM #19
That was it Brice. The only difference I found between my working scenario and your walkthrough was I didn't appear to have the cordova debug tool available. I used build instead and then installed the resulting apk using adb.
Thanks again for your help, I appreciate it.
-
14 Jan 2013 7:21 AM #20
You're right about the debug script, this is different in PhoneGap 2.3.0. Here's how I implement that after build target with 2.3.0:
It looks like that cordova script manages all the different options. If you open that up you'll see the different functions that can be used. The build script that you're using ends up calling this cordova script in the end. Either way works though.Code:<target name="-after-build-android"> <exec executable="${cordova.android.project}/cordova/cordova"> <arg value="run" /> </exec> </target>
I'm glad you got it working for you. Sorry to have wasted your time with that past line of questioning.
BriceBrice Mason
Front End Developer
Modus Create
@bricemason
bricemason.com
Sencha Touch Screencasts
Vimeo - Sencha Touch Channel
Github Projects:
Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.
Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.
Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.


Reply With Quote