1. #11
    Sencha User
    Join Date
    Oct 2012
    Posts
    71
    Vote Rating
    2
    Tioecomp is on a distinguished road

      0  

    Default


    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

  2. #12
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    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:

    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>
    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.

    Brice
    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.

  3. #13
    Sencha User
    Join Date
    Oct 2012
    Posts
    71
    Vote Rating
    2
    Tioecomp is on a distinguished road

      0  

    Default


    Thks Brice,

    Everything is fine now.

  4. #14
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    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
    Feedback as always is welcome.

    https://github.com/bricemason/sencha-cordova-builder

    Brice
    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.

  5. #15
    Sencha User
    Join Date
    Dec 2012
    Posts
    11
    Vote Rating
    6
    airaid is on a distinguished road

      0  

    Default


    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:

    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.
    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.

    Any idea what I might be doing wrong?

    Thanks

    Gareth

  6. #16
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    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:

    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
    You can see there on the second to last line where the android project is created.

    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?

    Brice
    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.

  7. #17
    Sencha User
    Join Date
    Dec 2012
    Posts
    11
    Vote Rating
    6
    airaid is on a distinguished road

      0  

    Default


    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.

    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$
    Thanks for your help Brice.

  8. #18
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    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:

    Code:
    ANDROID_BIN="$'{'ANDROID_BIN:=$( which android )'}'"
    is from the PhoneGap create script. It's attempting to get the path to the android program from your path.

    When you run the command:

    Code:
    which android
    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:
    /Users/bricemason/lib/android-sdk-macosx/tools/android
    Brice
    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.

  9. #19
    Sencha User
    Join Date
    Dec 2012
    Posts
    11
    Vote Rating
    6
    airaid is on a distinguished road

      0  

    Default


    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.

  10. #20
    Sencha User bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    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:

    Code:
    <target name="-after-build-android">
       <exec executable="${cordova.android.project}/cordova/cordova">
          <arg value="run" />
       </exec>
    </target>
    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.

    I'm glad you got it working for you. Sorry to have wasted your time with that past line of questioning.

    Brice
    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.