PDA

View Full Version : Sencha Cordova Builder - Automated Builds for PhoneGap Projects

bricemason
14 Dec 2012, 10:47 PM
Hey All,

I have been experimenting with Ant integration in the Sencha Touch build process lately. I'm totally new to Ant but quickly became excited by its capability.

As a way to dig in, I created a project that automates the creation, building, and running of Android and iOS enabled PhoneGap projects with Sencha Touch. My goal was to make something that worked with the framework and was as easy to use as possible without requiring any extra installs. I'd be glad to get some feedback on it. I have been using it for quick mockups and light development tasks.

You can check it out on github: https://github.com/bricemason/sencha-cordova-builder

I'll also do a screencast early next week to go over how to use it.

Brice

mitchellsimoens
17 Dec 2012, 6:53 AM
Pretty nice!

trinitrotoluen
21 Dec 2012, 9:35 PM
cool, It's gonna be very useful coz for now I more prefer using phonegap compared with sencha native packager. Waiting for the screencast ~o)

bcichowlas
22 Dec 2012, 1:12 PM
This looks really useful, but I'm not sure that I completely understand. Can this be used with Sencha Architect/Touch 2.1 to make .api's that will run on IOS devices? I would really like a working example that I could examine carefully and model. Thanks.

bcichowlas
22 Dec 2012, 5:26 PM
Just when I was about to give up for the time being, I managed to use Architect/Touch 2.1 to build one Sencha app and then another, rather than using PhoneGap. (I had originally shifted to PhoneGap because Architect was not packaging correctly for me, but now I know how to do it.)

There are simply a lot of details necessary to get the packager file right. When it is wrong, the error message can be quite obscure, sometimes consisting of just a number. Also, sometimes one sees seemingly contradictory messages in the output: one messages says packaging has failed, another says it has succeeded.

For me, here were some important points:

I had thought that Certificate alias was a path to my Certificate copy. That's wrong. It's a name for the *developer* certificate. If you are the only developer, you may be able to get away by just saying "iPhone Developer", but if you have several developer accounts on your machine you may need to say as much as iPhone Developer: Bruce Cichowlas (XLBH3396K5) . How did I find this out? Try saying just "iPhone Developer" and if it doesn't like it, it will say it is ambiguous and give you some idea of what it wants.

I also put my password on the next entry in the packager. I'm not sure that it was necessary and I'm not sure exactly which password it wanted.

I used "Production" for my Ad Hoc build, but maybe "Debug" would have worked.

Your application id must match what you set up at the Apple development site. In my case, it was com.realkeysmusic.divs . I used my Ad Hoc provision file (after setting up the UDID's etc. at the Apple developer site. I copied it to my project root directory (the one with app.html) and said ./Divs_Ad_Hoc.mobileprovision for provisionProfile.

So I ended up using the packager within Sencha Architect rather than using PhoneGap at all for IOS, even though it seemed OK for Android --- so in some ways this is not an answer to the question here but rather an alternative.

bricemason
23 Dec 2012, 11:51 PM
Here's the screencast which runs through an example of setting up a project and building for both android and ios.

The goal of this project is to give a simple way to wrap a sencha touch 2.1 app with phonegap using the build process exposed by sencha cmd.

https://vimeo.com/56231285

Brice

snam
27 Dec 2012, 11:03 AM
This is excellent material!!

Thanks for taking the time to put this ant script together.
And for the nicely done tutorial...

Keep up the good work.

Cheers

azche
28 Dec 2012, 8:38 AM
This is great!

Tioecomp
7 Jan 2013, 5:10 PM
Brice,

Your tutorial is very detailed, but I'm having problem to get it working on windows 7 with the path to the files, I tried C:\Users\Bernardo\Desktop\sencha-cordova-builder-master\build.cordova.xml and C:/Users/Bernardo/Desktop/sencha-cordova-builder-master/build.cordova.xml but at the build process the build.cordova.xml cant be found. Anyone have this working on windows 7?

bricemason
7 Jan 2013, 5:27 PM
You're close. Assuming the project is extracted to your desktop, the path to the main build file would be:

C:/Users/Bernardo/Desktop/sencha-cordova-builder-master/build-cordova.xml

In addition to this you'll need to modify the path to the 'create' scripts in the cordova.properties file. Specifically, change:

cordova.ios.tools.bin.create=${cordova.ios.tools.bin}/create to: cordova.ios.tools.bin.create=${cordova.ios.tools.bin}/create.bat

and change:

cordova.android.tools.bin.create=${cordova.android.tools.bin}/create to: cordova.android.tools.bin.create=${cordova.android.tools.bin}/create.bat

I have had others report that they've used this on windows with success. I'll be including better out of the box support for windows very soon, probably the next week or two so be sure to check back for updates.

Brice

Tioecomp
7 Jan 2013, 6:24 PM
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

bricemason
7 Jan 2013, 10:38 PM
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:

<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 Tioecomp 8 Jan 2013, 11:28 AM Thks Brice, Everything is fine now. bricemason 9 Jan 2013, 11:04 PM 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 airaid 12 Jan 2013, 5:38 AM 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: [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 bricemason 12 Jan 2013, 12:22 PM 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: [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 airaid 14 Jan 2013, 2:55 AM 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. 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] [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 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.Target.execute(Target.java:392)
[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.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.Target.execute(Target.java:392)
[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. bricemason 14 Jan 2013, 4:51 AM 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: 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: 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: /Users/bricemason/lib/android-sdk-macosx/tools/android Brice airaid 14 Jan 2013, 6:56 AM 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. bricemason 14 Jan 2013, 7:21 AM 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: <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

airaid
14 Jan 2013, 8:09 AM
Perfect, thanks Brice. One thing you're definitely not doing is wasting my time!

karensilkwood
15 Jan 2013, 8:51 AM
Hi Brice,

I am having similar issue as airaid, except I dont get the following msg in Command

ANDROID_BIN="$'{'ANDROID_BIN:=$( which android )'}'"This is mine out put:

[INF] -init-android-internal:
[INF] [echo] initializating android build...
[INF] [echo] creating android project with the following details:

[INF] [echo] project path: C:\inetpub\wwwroot\NoteApp\build\NoteA
pp\android
[INF] [echo] project namespace: com.developiq.NoteApp
[INF] [echo] project name: NoteApp
[INF] [exec] Missing one of the following:
[INF] [exec] JDK: http://java.oracle.com
[INF] [exec] Android SDK: http://developer.android.com
[INF] [exec] Apache ant: http://ant.apache.org
[ERR] [exec] Result: 1
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: C:\inetpub\wwwroot\NoteApp
\build\NoteApp\android does not exist.
[ERR] at com.sencha.exceptions.BasicException.wrap(BasicExcept
ion.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(AbstractComma
nd.java:182)
2)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava: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$BasePluginComma nd.run(BasePluginCommands.java:87) [ERR] at com.sencha.command.BasePluginCommands$BasePluginComma
nd.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCom mand.run(BasePluginCommands.java:135) [ERR] at com.sencha.command.app.AppCommands$BuildCommand.execu
te(AppCommands.java:106)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[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: C:\Users\Documents\_SRC\_sencha\bricemas
on-sencha-cordova-builder-75c7c5b\build-cordova-android.xml:59: C:\inetpub\wwwro
ot\NoteApp\build\NoteApp\android does not exist.
[ERR] at org.apache.tools.ant.types.AbstractFileSet.getDirecto
ryScanner(AbstractFileSet.java:483)
.java:542)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava: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 M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] ... 31 more
[ERR] Total time: 17 seconds
[ERR] com.sencha.exceptions.BasicException: C:\inetpub\wwwroot\NoteApp
\build\NoteApp\android does not exist.

Any idea what is going on? I should have all the latest required files as I grabbed everything today.

Cheers
Karen

bricemason
15 Jan 2013, 9:19 AM
Hi Karen,

It looks like you're missing one or more requirements of PhoneGap. This snippet from your log output:

[INF] [echo] project path: C:\inetpub\wwwroot\NoteApp\build\NoteA
pp\android
[INF] [echo] project namespace: com.developiq.NoteApp
[INF] [echo] project name: NoteApp
[INF] [exec] Missing one of the following:
[INF] [exec] JDK: http://java.oracle.com
[INF] [exec] Android SDK: http://developer.android.com
[INF] [exec] Apache ant: http://ant.apache.org
[ERR] [exec] Result: 1

relates to that. Make sure that each of these requirements is also in your system PATH. You can confirm this by issuing the commands:

java
javac
android
ant

If you see output like not recognized as an internal command, then it's not installed and/or not in your system PATH. I also believe on Windows you should be able to issue commands:

where java
where android
where ant

to find out where they've been installed to. Not totally sure on that but give it a try if need be.

Try these tips and let us know if you run into more trouble.

Brice

karensilkwood
16 Jan 2013, 8:53 AM
Cheers Brice for the uber quick response. I dunno how I missed them.
I've added them to my path. they seems fine now.
However now when I do the package generation I get the following error

ruby 1.9.3p362 (2012-12-25) [i386-mingw32]

C:\Users\dc>cd C:\inetpub\wwwroot\NoteApp

C:\inetpub\wwwroot\NoteApp>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]
[INF] [shellscript] C:\inetpub\wwwroot\NoteApp\resources\sass>compass
compile --boring --force
[INF] [shellscript] identical ../css/app.css
[INF] -after-sass:
[INF] page:
[INF] -before-page:
[INF] -page:
[INF] building application
[INF] Deploying your application to C:\inetpub\wwwroot\NoteApp\build\N
oteApp\package
[INF] Copied app.js
[INF] Copied resources/css/app.css
[INF] Copied C:\inetpub\wwwroot\NoteApp\resources\images
[INF] Copied C:\inetpub\wwwroot\NoteApp\resources\icons
[INF] Copied C:\inetpub\wwwroot\NoteApp\resources\startup
[INF] Resolving your application dependencies (file:///C:/inetpub/wwwr
oot/NoteApp/index.html)
[INF] Compiling app.js and dependencies
[INF] Processing classPath entry : C:\inetpub\wwwroot\NoteApp\sencha-c
ompile-temp-dir
[INF] Processing classPath entry : C:\inetpub\wwwroot\NoteApp\touch\sr
c
[INF] Processing classPath entry : C:\inetpub\wwwroot\NoteApp\app.js
[INF] Processing classPath entry : C:\inetpub\wwwroot\NoteApp\app
[INF] Processing class inheritance graph
[INF] Processing instantiation refereces to classes and aliases
[INF] Processing source dependencies
[INF] Concatenating output to file C:\inetpub\wwwroot\NoteApp\build\No
teApp\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 C:\inetpub\wwwroot\Not
eApp\build\NoteApp\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] [echo] checking android initialization using the following
resources:
[INF] [echo] cordova library \Users\dc\Documents\_SRC\_
sencha\phonegap-2.3.0
[INF] [echo] android tools \Users\dc\Documents\_SRC\_se
ncha\phonegap-2.3.0\lib\android\bin
[INF] [echo] android create script \Users\dc\Documents\
_SRC\_sencha\phonegap-2.3.0\lib\android\bin\\create.bat
[INF] [echo] android project C:\inetpub\wwwroot\NoteApp\build\Not
eApp\android
[INF] [echo] android project built state...true
[INF] -before-init-android-internal:
[INF] -init-android-internal:
[INF] -after-init-android-internal:
[INF] -init-android:
[INF] -before-build-android-internal:
[INF] -build-android-internal:
[INF] -after-build-android-internal:
[INF] -deploy-android:
[INF] -build-android:
[INF] -build-cordova-all:
[INF] -check-os:
[INF] -make-unix-property-paths:
[INF] -make-windows-property-paths:
[INF] -init-properties:
[INF] -is-ios-built:
[INF] -set-windows-create-script:
[INF] -set-unix-create-script:
[INF] [echo] checking ios initialization using the following reso
urces:
[INF] [echo] cordova library \Users\dc\Documents\_SRC\_
sencha\phonegap-2.3.0
[INF] [echo] ios tools \Users\dc\Documents\_SRC\_sencha
\phonegap-2.3.0\lib\ios\bin
[INF] [echo] ios create script \Users\dc\Documents\_SRC
\_sencha\phonegap-2.3.0\lib\ios\bin\\create.bat
[INF] [echo] ios project C:\inetpub\wwwroot\NoteApp\build\NoteApp
\ios
[INF] [echo] ios project built state...false
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
[ERR] C:\Users\dc\Documents\_SRC\_sencha\bricemason-sencha-c
ordova-builder-75c7c5b\check-cordova.xml:122: one or more of the resources requi
red to initialize the ios project cannot be resolved
[ERR] at com.sencha.exceptions.BasicException.wrap(BasicExcept
ion.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(AbstractComma
nd.java:182)
2)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava: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$BasePluginComma nd.run(BasePluginCommands.java:87) [ERR] at com.sencha.command.BasePluginCommands$BasePluginComma
nd.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCom mand.run(BasePluginCommands.java:135) [ERR] at com.sencha.command.app.AppCommands$BuildCommand.execu
te(AppCommands.java:106)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[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: C:\Users\dc\Documents\_SRC\_sencha\bricemas
on-sencha-cordova-builder-75c7c5b\build-cordova.xml:36: The following error occu
rred while executing this line:
[ERR] C:\Users\dc\Documents\_SRC\_sencha\bricemason-sencha-c
ordova-builder-75c7c5b\check-cordova.xml:122: one or more of the resources requi
red to initialize the ios project cannot be resolved
Exception(ProjectHelper.java:551)
4)
Target.java:105)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava: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 M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] ... 31 more
[ERR] Caused by: C:\Users\dc\Documents\_SRC\_sencha\bricemas
on-sencha-cordova-builder-75c7c5b\check-cordova.xml:122: one or more of the reso
urces required to initialize the ios project cannot be resolved
164)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.helper.SingleCheckExecutor.execu
teTargets(SingleCheckExecutor.java:38)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava:1251)
2)
[ERR] ... 52 more
[ERR] Total time: 16 seconds
[ERR] com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
C:\Users\dc\Documents\_SRC\_sencha\bricemason-sencha-cordova-builder-7
5c7c5b\check-cordova.xml:122: one or more of the resources required to initializ
e the ios project cannot be resolved

C:\inetpub\wwwroot\NoteApp>

Any idea what can be those ios resources that I missing?
Can it be coursed cos I am on Win?

Thanks for everything once again

bricemason
16 Jan 2013, 9:37 AM
Karen,

You're right about iOS on Windows. That's not going to happen, however it should have at least created the project using the PhoneGap create scripts. If you just want to build for android, I'd recommend just implementing the -build-android target instead of -build-cordova-all.

Your earlier post showed the proper paths like

[echo] project path: C:\inetpub\wwwroot\NoteApp\build\NoteApp\android

however your most recent log snippet includes paths such as:

[INF] [echo] cordova library \Users\dc\Documents\_SRC\_sencha\phonegap-2.3.0
[INF] [echo] ios tools \Users\dc\Documents\_SRC\_sencha\phonegap-2.3.0\lib\ios\bin
[INF] [echo] ios create script \Users\dc\Documents\_SRC\_sencha\phonegap-2.3.0\lib\ios\bin\\create.bat

This current attempt failed because of these paths. You'll notice that the same type of paths were also in your android build but since that project was already created and initialized if wouldn't matter.

Would you please post your complete cordova.properties file? I want to check it out to see if I have a bug in the builder.

If you're willing/able to, I would also recommend that you delete the build and start again by:
Delete all [I]_<platform>.built and _<platform>.deploy files in the root of your Sencha app
Delete all cordova-android.js and cordova-ios.js files in the root of your Sencha app
Delete all directories under the build directory of your Sencha app
Change your build.xml to only build for android using -build-android
Since you're on Windows, you will need to delete those _<platform>.built and _<platform>.deploy files before each build. I'm working on better scripts for Windows folks so you won't have to do that anymore.

Let me know if you run into any more issues. Your feedback helps out a lot.

Brice

slick84
16 Jan 2013, 5:04 PM
Hi,

Could you please help me understand why I would wrap my Sencha Touch developed application with PhoneGap versus through the Sencha SDK?

Ive been trying to find a reason or pros or advantages of doing this? I would highly appreciate your response.

Thanks,
S

bricemason
16 Jan 2013, 5:53 PM
Hi S,

Just off the top of my head I would offer the following advantages to using PhoneGap over the Sencha native APIs:

PhoneGap has broader support for different platforms (android, ios, blackberry, symbian, webOS, windows phone 7, windows phone 8, windows 8, bada, tizen)
PhoneGap has broader support for native APIs. The Sencha native APIs only account for a handful
PhoneGap has a rich plugin framework which you can both leverage what's already been written or create your own
Brice

slick84
16 Jan 2013, 6:15 PM
That's good to know. As a future state we intend on accessing native SQLite storage and I believe the SQLite Plugins for PhoneGap will come to use.

I've heard that wrapping a Sencha Touch application in PhoneGap adds unnecessary baggage making the application bloated. Is there any truth to that? or if it is true, to what extent? Making the application unusable?

karensilkwood
17 Jan 2013, 2:38 AM
Hi Brice,

It's a Success! I've deleted all those files you have mentioned and changed to -build-android istead of -build-all. Now If I run the packaging it all goes through fine. Cheers for all your help. I guess I will need to use my Mac for iOS builds. Also will it be any options with Cordova in the close future to deploy to Windows 8 and BB10 by any chance?

Once again, thanks for you prompt assistance and your great screencast. keep up the good work!:)

JRS
23 Jan 2013, 1:16 AM
Hi Brice,

I am following your screencast and downloaded the code from Github. I am working on Mac Mountain Lion, with Sencha 2.1 and Phonegap 2.3. Android SDK (latest version not sure what version)

Screencast is very straight forward and clear. However, in your readme file you say to run sencha install command. This is not done in the screen cast.

When I run the sencha app build package command - I only get the package no ios or android in the build directory. There are no errors.

I am thinking I am missing something in the install - however, I pretty sure I followed everything from the screencast - exactly!

Regards
JRS

UPDATE: Brice - I ran ./sencha install and then tried to build just for ios and that worked.
I will try to build for android only and see how that turns out.

Android alone also worked - problem appears to be when trying to build both using build-cordova-all.

bricemason
23 Jan 2013, 10:16 AM
@slick84 - I haven't noticed any huge bloat when wrapping with PhoneGap. Based on some tests I just ran, the sample app wrapped in PhoneGap and Sencha native packaging has some key differences. The resulting size of the PhoneGap-wrapped app is 684KB. The resulting size of the Sencha native packaged app is 17.2MB. Big difference there, not sure where it comes from. I will say also that the Sencha native packaged app isn't unusable. It is the sample app so take that for what it is. There are plenty of other ways we can make our apps unusable :)

@karensilkwood - I'm glad you got everything up and running! I am interested in supporting other platforms. I will have to make sure all else is stable first but if I had my choice, I'd try out Windows 8 first. I was a .NET developer for a while and like the platform.

@JRS - Yeah, the screencast is now outdated based on some recent updates. I will update that screencast by early next week, sorry for the confusion. Building both together should work in your case since it's basically calling those two separate targets together. You wrote in your post build-cordova-all. The target name to be used should be -build-cordova-all. Could you confirm this is what you implemented? Sounds silly, just wanted to double-check. If that doesn't work, please post your build.xml file and cordova.properties file for a quick inspection.

Thanks everyone for your feedback and help.

Brice

JRS
23 Jan 2013, 11:39 AM
Hi Brice,

I verified both your suggestions - I did have the proper spelling in both files - just tried it again and it all worked. It didn't when I posted - just need the word from you I guess!

Don't know what changed from last night to this afternoon - but it working now - the only thing I did was - I did shut my Mac down and rebooted it this morning - I wonder if that might have had any effect.

I'll try it on my app - as opposed to the Sencha default app and see how it goes.

Thanks again for your help and your projects
Much appreciated
JRS
PS: Perhaps you can just an add a note on the screencast to follow directions the readme file
Also, I added these lines in the cordova.properties (don't know if it is needed or not )

cordova.android.tools.bin.create=${cordova.android.tools.bin}/create cordova.ios.tools.bin.create=${cordova.ios.tools.bin}/create

JRS
23 Jan 2013, 2:06 PM
Sorry stupid error on my part - there was a debugger statement in one of the files.

erbud
24 Jan 2013, 9:47 AM
Hi guys,

First of all congratulate Brice, Sencha Cordova Builder is very comfortable and clean.

I've found an issue when using Sencha Touch 2 (Ext.device.Device) + PhoneGap. We describe in the following post:

You have found this scenario?

Regards,

bricemason
25 Jan 2013, 6:17 AM
@JRS - I'm glad you found the solution. As a side note, you had added that extra line to your cordova.properties file which defined the path to the phonegap 'create' script. This is fine but it wasn't necessary. The latest release of sencha cordova builder will automatically determine the 'create' script to use. This helps it be os-independent. If you were were working in a PC environment, it would have automatically determined that you'd need to use 'create.bat' instead of 'create'

@erbud - Did you check out the docs on Ext.device.Device? There's a note in there that says that class will only work in the Sencha native packager. The specific snippet states:

PLEASE NOTE: This currently only works with the Sencha Native Packager. If you attempt to listen to this event when packaged with PhoneGap or simply in the browser, it will not function.

Here's a link to the docs: http://docs.sencha.com/touch/2-1/#!/api/Ext.device.Device

Brice

JRS
26 Jan 2013, 2:45 AM
Hi Brice,

Thanks for all your help - I have builder working - however, I've noticed my App didn't work in the simulator after the build. After trying to debug it without success, I decided to copy the sources to Corodova www directory and test the app. The app worked without any issues.

I just wanted to let people know if they run into problems - try the manual method to verify before spending a lot of time - trying to figure out what might be happening with the build package.

I believe in my case the problems were being caused by the model & store - classes. But haven't really investigated much - just relieved it wasn't my app causing the crash!

Regards
JRS

bricemason
30 Jan 2013, 10:05 PM
JRS,

Thanks for the feedback. If you uncover any specifics regarding potential bugs in the builder that may have contributed to your troubles, please give me a shout. Your use and critique of the project will help me improve it.

Brice

pcr
3 Feb 2013, 2:46 AM
Hi Brice,

Would be nice to have such a nice tool

I watched your video and wanted to use Cordova Builder.
I downloaded unzipped and install your script on my iMac.
If I build my app this is reported:

[INF] [echo] checking ios initialization using the following resources:
[INF] [echo] ios project /Applications/Dropbox/Quitte/build/Quitte/ios
[INF] [echo] ios project built state...false
[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: one or more of the resources required to initialize the ios project cannot be resolved
[ERR]

I dont have a clue where to look to resolve this.

I get the same if I try the builer for android. The echos then say the same excecpt for android

I have cordova-2.3.0 and the android SDK installed yesterday.

Maybe there is something I missed to do....

Can you help me

I appreciate your help

bricemason
4 Feb 2013, 6:07 AM
This has to do with the use of tilde expansion paths in your cordova.properties file. Change the path to your phonegap lib from using ~, to the full path and it should work. For example, I tested mine like this:

cordova.lib=~/lib/phonegap-2.3.0

and got the error but when I changed to the full path:

cordova.lib=/Users/bricemason/lib/phonegap-2.3.0

it worked fine. Give that a go and post back if you have any other troubles.

Brice

pcr
4 Feb 2013, 7:49 AM
Ah Brice.

That make sense. Now there is another problem. In the meantime I switched to cordova-2.2.0. Now it seems it works.
I dived in the changes cordova made in cordova-2.3.0;

I know nothing about ant and/or java. But I gave it a try. Here is what I have.

I discovered that the bin directories of the different platforms are no more in lib/ios, lib/android.
Instead they are in cordova-ios and cordova-android

I changed som properties according these changes. But now android isn't build. What I saw is that <target name="-init-android-internal" never executed. I can't figure out why!!.

I know you can.

Did you allready have patched the builder for cordova 2.3.0???

bricemason
4 Feb 2013, 8:15 PM
The builder has been tested successfully up to PhoneGap 2.3. I'm not seeing where the bin directories have been moved in 2.3. Even in the most recent 2.4 release candidate code, the bin directories are where they should be. Check out this link to the phonegap github repo which shows the scripts in the android directory like all the other versions:

https://github.com/phonegap/phonegap/tree/master/lib/android/bin

I will say however that as of 2.3 I did make a change to how the cordova javascript file is picked up and moved to the sencha app. Before, it was handled by relying on a location of a standard template or example project in each phonegap platform directory. This did change in 2.3. When the project is first created, that cordova library is created in the root of the app with the name of cordova-{version}.js where {version} is the version of phonegap. Perhaps this is the change you're referring to? If your version of the file build-cordova-android.xml does NOT contain this snippet:

<script language="javascript">
var versionFile = new java.io.File(project.getProperty('cordova.lib') + '/VERSION');
var versionString = org.apache.commons.io.FileUtils.readFileToString(versionFile);
var regex = "\\n";
versionString = versionString.replaceAll(regex, "");
project.setProperty('cordova.lib.version', versionString);
</script>

<property name="cordova.android.tools.js" value="${cordova.android.project.www}/cordova-${cordova.lib.version}.js" />

Then you should go out and get the latest version of the builder here:

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

As far as the -init-android-internal target not being called, it's probably because you have the _android.built and/or _android.deploy files in the root of your sencha app. Those need to be deleted before every build for it to run again. If you don't want to do that manually or make your own script, I ship a proxy to the sencha command that will do it for you.

Sorry this is flood of info coming at you here. If this doesn't answer your questions, please post your cordova.properties file so I can take a look.

Again, thanks for using the project.

Brice

pcr
5 Feb 2013, 1:45 AM
Hi Brice.

The builder works fine now. Even on phonegap 2.4rc1.
My pitfall however was I downloaded and installed From the Cordova website Cordova 2.3.0.

This could maybe for all other people who try cordova-builder.

The phonegap install form github phonegap is working perfect.

Thanks Brice for support

bricemason
5 Feb 2013, 5:40 AM
I'm not seeing the different folder structure for phonegap 2.3. I just downloaded it and took a screenshot to the android bin folder.

Could you please post more details in what you're seeing as the different directory structure that was causing issues for you?

I have attached a screenshot of the directory path to the android bin for a freshly downloaded phonegap 2.3.

Brice

pcr
6 Feb 2013, 12:41 AM
Hi Brice. Just to be clear. The different filestructure is not between Phonegap 2.2 and Phonegap 2.3.
The different is between Phonegap 2.3 and Cordova 2.3

bricemason
6 Feb 2013, 10:24 AM
I understand now. To answer the question, sencha cordova builder is meant to work with the phonegap implementation.

Brice

rsatyan
6 Feb 2013, 4:15 PM
[INF] [echo] checking android initialization using the following resources:
[INF] [echo] cordova library /User/y001457/tools/phonegap-2.3.0
[INF] [echo] android tools /User/y001457/tools/phonegap-2.3.0/lib/android/bin
[INF] [echo] android create script /User/y001457/tools/phonegap-2.3.0/lib/android/bin/create
[INF] [echo] android project /Users/y001457/apps/myApp/build/myApp/android
[INF] [echo] android project built state...false
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: one or more of the resources required to initialize the android project cannot be resolved

pcr
7 Feb 2013, 4:03 AM
Hi I see you use different pathnames. IMO your path to Phonegap starts with :/User and your path to the project starts with :/Users.

/User must be a personal path.
/Users is the default iMac path for users

This must be a typo, right?

rsatyan
7 Feb 2013, 5:54 AM
Absolutely right. Thanks for catching it!

webdev13
18 Feb 2013, 11:26 AM
I'm new here , i was searching in this forum how to integrate sencha touch and phonegap , i spent a lot of days to do this .you are just great , thanks a lot ,however

i have a question please (forgive me if its wrong question) : how to generate apk file in order to test it on my real device , i'm trying to add project to eclipse , but i could not kindly find images in attachments 4192241923

can you guide me please ?

best regards

webdev13
18 Feb 2013, 11:57 AM
excuse me , i also have the following error :

[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
[ERR] C:\wamp\www\myApp\build.xml:7: Execute failed: java.io.IOExcepti
on: Cannot run program "C:\wamp\www\myApp\build\myApp\android\cordova\debug": Cr
eateProcess error=2, The system cannot find the file specified

i work on windows 7

regards

ashishpok
18 Feb 2013, 4:19 PM
Brice, excellent tool... just what I was looking for !!!!

I am set building package in Windows environment for android, one thing I am missing is build.xml file within the build folder. It looks like ant is not able to find the file and my debug / emulate step doesn't work.

Would can you give any pointers on why build.xml file might be missing in build\<my-app>\android folder?

Thanks,

- A

ashishpok
18 Feb 2013, 4:21 PM
Brice has already answered this if you scroll to the page 2 (i believe)...

You are probably using newer version of PhoneGap / Cordova (2.3+)..

bcichowlas
18 Feb 2013, 6:39 PM
Just to clarify, can you use Adobe Phonegap Build with Sencha Architect 2.0? Is there a particular build of Cordova or PhoneGap you would use?

webdev13
19 Feb 2013, 1:04 AM
thanks

but also when i add the following script

{
title: 'Welcome',
iconCls: 'home',

styleHtmlContent: true,
tpl:[
'device: {name}</br>',
'phonegap version {cordova}'
].join(''),

listeners :{
initialize : function(){

this.setData(device);

}

}
}
i see the following error

Uncaught ReferenceError: device is not defined

and its not working on virtual device
, any idea please ?

best regards

webdev13
19 Feb 2013, 1:51 AM
i have generated .apk files located in bin folder , but debug still not working , here is my build.xml file

<import file="${basedir}/.sencha/app/build-impl.xml"/> <import file="/sencha-cordova-builder-master/build-cordova.xml" /> <target name="-after-build" depends="-build-android" /> <target name="-after-build-android"> <exec executable="ant"> <arg value="-buildfile" /> <arg value="${cordova.android.project}/build.xml" />
<arg value="debug" />
</exec>

<arg value="install" />
<arg value="-r" />
<arg value="${cordova.android.project}/bin/${app.name}-debug.apk" />
</exec>
</target>

and i get the following error

[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
[ERR] C:\wamp\www\myApp1\build.xml:9: Execute failed: java.io.IOExcept
ion: Cannot run program "ant": CreateProcess error=2, The system cannot find the
file specified
[ERR] at com.sencha.exceptions.BasicException.wrap(BasicExcept
ion.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(AbstractComma
nd.java:182)
2)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava: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$BasePluginComma nd.run(BasePluginCommands.java:87) [ERR] at com.sencha.command.BasePluginCommands$BasePluginComma
nd.run(BasePluginCommands.java:91)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCom mand.run(BasePluginCommands.java:135) [ERR] at com.sencha.command.app.AppCommands$BuildCommand.execu
te(AppCommands.java:106)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[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: C:\sencha-cordova-builder-master\build-cordova-androi
d.xml:40: The following error occurred while executing this line:
[ERR] C:\wamp\www\myApp1\build.xml:9: Execute failed: java.io.IOExcept
ion: Cannot run program "ant": CreateProcess error=2, The system cannot find the
file specified
Exception(ProjectHelper.java:551)
4)
Target.java:105)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja
va:1368)
[ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa
rgets(DefaultExecutor.java:41)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava: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 M
ethod)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] ... 31 more
[ERR] Caused by: C:\wamp\www\myApp1\build.xml:9: Execute failed: java.
io.IOException: Cannot run program "ant": CreateProcess error=2, The system cann
ot find the file specified
sk.java:675)
sk.java:498)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl
ement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S
ource)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno
wn Source)
[ERR] at java.lang.reflect.Method.invoke(Unknown Source)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D
ispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
413)
[ERR] at org.apache.tools.ant.Project.executeSortedTargets(Pro
ject.java:1399)
[ERR] at org.apache.tools.ant.helper.SingleCheckExecutor.execu
teTargets(SingleCheckExecutor.java:38)
[ERR] at org.apache.tools.ant.Project.executeTargets(Project.j
ava:1251)
2)
[ERR] ... 52 more
[ERR] Caused by: java.io.IOException: Cannot run program "ant": Create
Process error=2, The system cannot find the file specified
[ERR] at java.lang.ProcessBuilder.start(Unknown Source)
[ERR] at java.lang.Runtime.exec(Unknown Source)
[ERR] at org.apache.tools.ant.taskdefs.Execute$Java13CommandLa uncher.exec(Execute.java:862) [ERR] at org.apache.tools.ant.taskdefs.Execute.launch(Execute. java:481) [ERR] at org.apache.tools.ant.taskdefs.Execute.execute(Execute .java:495) [ERR] at org.apache.tools.ant.taskdefs.ExecTask.runExecute(Exe cTask.java:631) [ERR] at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTa sk.java:672) [ERR] ... 65 more [ERR] Caused by: java.io.IOException: CreateProcess error=2, The syste m cannot find the file specified [ERR] at java.lang.ProcessImpl.create(Native Method) [ERR] at java.lang.ProcessImpl.<init>(Unknown Source) [ERR] at java.lang.ProcessImpl.start(Unknown Source) [ERR] ... 72 more [ERR] Total time: 56 seconds [ERR] com.sencha.exceptions.BasicException: The following error occurr ed while executing this line: C:\wamp\www\myApp1\build.xml:9: Execute failed: java.io.IOException: Cannot run program "ant": CreateProcess error=2, The system cannot find the file specified best regards ashishpok 19 Feb 2013, 6:08 AM Brice, excellent tool... just what I was looking for !!!! I am set building package in Windows environment for android, one thing I am missing is build.xml file within the build folder. It looks like ant is not able to find the file and my debug / emulate step doesn't work. Would can you give any pointers on why build.xml file might be missing in build\<my-app>\android folder? Thanks, - A Fixed the issue. I just had to follow the steps provided here to ensure cordova / phonegap was building properly. http://simonmacdonald.blogspot.ca/2012/11/getting-create-command-to-work-on.html webdev13 19 Feb 2013, 10:37 AM thanks but also when i add the following script { title: 'Welcome', iconCls: 'home', styleHtmlContent: true, tpl:[ 'device: {name}</br>', 'phonegap version {cordova}' ].join(''), listeners :{ initialize : function(){ this.setData(device); } } } i see the following error Uncaught ReferenceError: device is not defined and its not working on virtual device , any idea please ? best regards i still cant not fix this problem , would u help me please ashishpok 19 Feb 2013, 11:22 AM Just to clarify, can you use Adobe Phonegap Build with Sencha Architect 2.0? Is there a particular build of Cordova or PhoneGap you would use? I am using PhoneGap 2.4 with ST2.1 and Sencha Cmd 3.0. This is working fine in Windows environment for me. I have not used Architect though. The only difference from Brice's video is to use run.bat instead of debug for launching Android Emulator after build is done. ashishpok 19 Feb 2013, 11:26 AM @webdev13, sorry I am not sure what could possibly be wrong. I am pretty new to using ST2 and PhoneGap. I had some weird issues running the app initially. What helped me was 1. making sure _android.built file is deleted before running the app build. 2. delete build/<app>/android folder and let the build create it from scratch. If I do both my issues get resolved. That's all I can say... not sure why I would have to delete android build at this point. bricemason 19 Feb 2013, 6:03 PM @webdev13, this snippet from your build output tells the story: [ERR] BUILD FAILED[ERR] com.sencha.exceptions.BasicException: The following error occurred while executing this line:[ERR] C:\wamp\www\myApp1\build.xml:9: Execute failed: java.io.IOException: Cannot run program "ant": CreateProcess error=2, The system cannot find the file specified you need to install ant from here: http://ant.apache.org/ Once you do that, try to build again. If you're on windows, make sure you delete the _android.built file before rebuilding. Let us know if you still need help. Brice webdev13 20 Feb 2013, 1:22 AM Hi bricemason, thanks for your support and help . let me show more details first i installed ant : 41955 and phonegap folder in C:\phonegap-2.4.0 and builder in C:\sencha-cordova-builder-master cordova.properties file : cordova.lib=\\phonegap-2.4.0 # files used to determine when building has finished cordova.flags.built.android=${basedir}\\_android.built
cordova.flags.built.ios=${basedir}\\_ios.built cordova.flags.deploy.android=${basedir}\\_android.deploy
cordova.flags.deploy.ios=${basedir}\\_ios.deploy # android tools and resources cordova.android.tools=${cordova.lib}\\lib\\android
cordova.android.tools.bin=${cordova.android.tools}\\bin # android project cordova.android.project=${build.dir}\\android
cordova.android.project.www=${cordova.android.project}\\assets\\www cordova.android.project.name=${app.name}
cordova.android.project.namespace=com.example.${cordova.android.project.name} cordova.android.project.js.name=cordova-android.js cordova.android.project.js=${basedir}\\${cordova.android.project.js.name} cordova.android.project.app.json.name=app-android.json cordova.android.project.app.json=${basedir}\\${cordova.android.project.app.json.name} # ios tools and resources cordova.ios.tools=${cordova.lib}\\lib\\ios
cordova.ios.tools.bin=${cordova.ios.tools}\\bin # ios project cordova.ios.project=${build.dir}\\ios
cordova.ios.project.www=${cordova.ios.project}\\www cordova.ios.project.name=${app.name}
cordova.ios.project.namespace=com.example.${cordova.ios.project.name} cordova.ios.project.js.name=cordova-ios.js cordova.ios.project.js=${basedir}\\${cordova.ios.project.js.name} cordova.ios.project.app.json.name=app-ios.json cordova.ios.project.app.json=${basedir}\\${cordova.ios.project.app.json.name} builder.xml file : <?xml version="1.0" encoding="utf-8"?> <project name="testbuilder" default=".help"> <import file="${basedir}/.sencha/app/build-impl.xml"/>
<import file="/sencha-cordova-builder-master/build-cordova.xml" />
<target name="-after-build" depends="-build-android" />

<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> <!-- The following targets can be provided to inject logic before and/or after key steps of the build process: The "init-local" target is used to initialize properties that may be personalized for the local machine. <target name="-before-init-local"/> <target name="-after-init-local"/> The "clean" target is used to clean build output from the build.dir. <target name="-before-clean"/> <target name="-after-clean"/> The general "init" target is used to initialize all other properties, including those provided by Sencha Cmd. <target name="-before-init"/> <target name="-after-init"/> The "page" target performs the call to Sencha Cmd to build the 'all-classes.js' file. <target name="-before-page"/> <target name="-after-page"/> The "build" target performs the call to Sencha Cmd to build the application. <target name="-before-build"/> <target name="-after-build"/> --> </project> but i still see the folowwing error : [ERR] BUILD FAILED [ERR] com.sencha.exceptions.BasicException: The following error occurr ed while executing this line: [ERR] C:\wamp\www\testbuilder\build.xml:10: Execute failed: java.io.IO Exception: Cannot run program "ant": CreateProcess error=2, The system cannot fi nd the file specified [ERR] at com.sencha.exceptions.BasicException.wrap(BasicExcept ion.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(AbstractComma nd.java:182) [ERR] at com.sencha.ant.SenchaCommandTask.doExecute(SenchaComm andTask.java:58) [ERR] at com.sencha.ant.BaseAntTask.execute(BaseAntTask.java:2 2) [ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl ement.java:291) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M ethod) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S ource) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno wn Source) [ERR] at java.lang.reflect.Method.invoke(Unknown Source) [ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D ispatchUtils.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(Pro ject.java:1399) [ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja va:1368) [ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa rgets(DefaultExecutor.java:41) [ERR] at org.apache.tools.ant.Project.executeTargets(Project.j ava: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$BasePluginComma
nd.run(BasePluginCommands.java:87)
[ERR] at com.sencha.command.BasePluginCommands$BasePluginComma nd.run(BasePluginCommands.java:91) [ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCom
mand.run(BasePluginCommands.java:135)
[ERR] at com.sencha.command.app.AppCommands$BuildCommand.execu te(AppCommands.java:106) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native M ethod) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S ource) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno wn Source) [ERR] at java.lang.reflect.Method.invoke(Unknown Source) [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: C:\sencha-cordova-builder-master\build-cordova-androi d.xml:40: The following error occurred while executing this line: [ERR] C:\wamp\www\testbuilder\build.xml:10: Execute failed: java.io.IO Exception: Cannot run program "ant": CreateProcess error=2, The system cannot fi nd the file specified [ERR] at org.apache.tools.ant.ProjectHelper.addLocationToBuild Exception(ProjectHelper.java:551) [ERR] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:44 4) [ERR] at org.apache.tools.ant.taskdefs.CallTarget.execute(Call Target.java:105) [ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl ement.java:291) [ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S ource) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno wn Source) [ERR] at java.lang.reflect.Method.invoke(Unknown Source) [ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D ispatchUtils.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(Pro ject.java:1399) [ERR] at org.apache.tools.ant.Project.executeTarget(Project.ja va:1368) [ERR] at org.apache.tools.ant.helper.DefaultExecutor.executeTa rgets(DefaultExecutor.java:41) [ERR] at org.apache.tools.ant.Project.executeTargets(Project.j ava: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 M ethod) [ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown S ource) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno wn Source) [ERR] at java.lang.reflect.Method.invoke(Unknown Source) [ERR] at com.sencha.cli.Command.dispatch(Command.java:78) [ERR] ... 31 more [ERR] Caused by: C:\wamp\www\testbuilder\build.xml:10: Execute failed: java.io.IOException: Cannot run program "ant": CreateProcess error=2, The syste m cannot find the file specified [ERR] at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTa sk.java:675) [ERR] at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTa sk.java:498) [ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownEl ement.java:291) [ERR] at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown S ource) [ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unkno wn Source) [ERR] at java.lang.reflect.Method.invoke(Unknown Source) [ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(D ispatchUtils.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(Pro ject.java:1399) [ERR] at org.apache.tools.ant.helper.SingleCheckExecutor.execu teTargets(SingleCheckExecutor.java:38) [ERR] at org.apache.tools.ant.Project.executeTargets(Project.j ava:1251) [ERR] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:44 2) [ERR] ... 52 more [ERR] Caused by: java.io.IOException: Cannot run program "ant": Create Process error=2, The system cannot find the file specified [ERR] at java.lang.ProcessBuilder.start(Unknown Source) [ERR] at java.lang.Runtime.exec(Unknown Source) [ERR] at org.apache.tools.ant.taskdefs.Execute$Java13CommandLa
uncher.exec(Execute.java:862)
java:481)
.java:495)
sk.java:672)
[ERR] ... 65 more
[ERR] Caused by: java.io.IOException: CreateProcess error=2, The syste
m cannot find the file specified
[ERR] at java.lang.ProcessImpl.create(Native Method)
[ERR] at java.lang.ProcessImpl.<init>(Unknown Source)
[ERR] at java.lang.ProcessImpl.start(Unknown Source)
[ERR] ... 72 more
[ERR] Total time: 49 seconds
[ERR] com.sencha.exceptions.BasicException: The following error occurr
ed while executing this line:
C:\wamp\www\testbuilder\build.xml:10: Execute failed: java.io.IOException: Canno
t run program "ant": CreateProcess error=2, The system cannot find the file spec
ified

i
and i dont see apk file in bin folder

i'm sure the phonegap builder working very fine and its great , but i dont know what happening in my machien

shanghailoz
20 Feb 2013, 7:18 PM
[ERR] C:\wamp\www\testbuilder\build.xml:10: Execute failed: java.io.IOException: Cannot run program "ant": CreateProcess error=2, The system cannot find the file specified

Make sure that ant is in the path.

If you type ant and press enter, does it show file not found, or does ant run?
If it shows file not found, you haven't setup the paths to the tools / sdk folder.
Reread the instructions on that step in the Android SDK install.

webdev13
20 Feb 2013, 10:00 PM
this is my what in path

C:\Program Files (x86)\Android\android-sdk;C:\java\ant\bin;C:\Program Files (x86)\Android\android-sdk\tools;C:\Program Files (x86)\Android\android-sdk\platform-tools;C:\Program Files\Java\jdk1.7.0_15\bin;C:\wamp\bin\php\php5.4.3

webdev13
20 Feb 2013, 10:23 PM
when i type and inside my project i get the following ,please find the image below
41974

rob.n
22 Feb 2013, 6:05 AM
Hi Brice and thanks for an excellent utility,

When using Phonegap 2.4.0 the javascript file is not located in
/lib/ios/ but in
/lib/ios/CordovaLib/
Small fix is to copy the file
/lib/ios/CordovaLib/cordova.ios.js to
/lib/ios/cordova-2.4.0.js

Better would of course be to find the file by itself and copy it : )

Best regards
Robert

webdev13
22 Feb 2013, 12:03 PM
i'm sorry to you, to add more comments , to be honest i got crazy cuz of this issue , i'm sure ant is installed , but i still see the same error again and again , see the attached image please
42006

i apologize again

bricemason
22 Feb 2013, 12:09 PM
@webdev13, no apologies necessary. Bundle up your project and post it. I'll take a look and even do a screencast with it if necessary so you can see everything I've tried. We'll get it straightened out.

Thanks,

Brice

webdev13
22 Feb 2013, 12:51 PM
thanks Brice ,
its very kind of you , kindly find the project at http://leads-map.com/myApp1.zip (http://leads-map.com/myApp1.zip)
but there is nothing special in the project , i was only testing your great utility , so i followed all your instructions .

anyway , thank you a lot

regards

giorgino
24 Feb 2013, 1:47 AM
Dear Brice,
first of all thank you for you great job!
I've a bit of experience in phonegap ios/andoird development but I'm totally new to ST; I succeded using your Sencha Cordova Builder, the app shows the correct version of phonegap, but now I don't know how to call the Phonegap API ! This seems to be a very silly question, but I tried anything which camed to my mind. I'm using ST2.1.1 , Phonegap 2.3.0, Windows7 64bit.
Let's do something really basic, like calling navigator.app.loadURL('http://www.google.com') : how can I do this inside my ST app ? I tried with a segmentedbutton, just because the test app had one already created and it was easy to modify it:

{
xtype: 'segmentedbutton',
allowDepress: false,
items: [
{ text: 'test1', handler: function() { loadUrl('http://www.google.com'); } },
{ text: 'test2', handler: function() { navigator.Test1.loadUrl('http://www.google.com'); } },
{ text: 'test3', handler: function() { Test1.navigator.loadUrl('http://www.google.com'); } },
{ text: 'test4', handler: function() { Test1.navigator.Test1.loadUrl('http://www.google.com'); } },
{ text: 'test5', handler: function() { Test1.navigator.app.loadUrl('http://www.google.com'); } },
{ text: 'test6', handler: function() { navigator.app.loadUrl('http://www.google.com'); } },
{ text: 'test7', handler: function() { navigator.loadUrl('http://www.google.com'); } }
]
}

but I always get an undefined <something> error...

Many thanks for your help!
Giorgio

rob.n
24 Feb 2013, 9:59 AM
Hi,

Im building apps used in different scenarios (chocking) and uses different namespace as to keep track of who and what the app is used for/by.

For example:
com.foo.internal.monitoring.Environment
com.foo.internal.monitoring.Backups
com.foo.internal.issue.Reporter

This is just some bad examples.

Currently i set the "base" namespace in cordova.properties, "com.foo.internal" and then in folder ".sencha" under my app i specify the namespace "monitoring.Enviroment" in sencha.cfg.

This generates a ugly XCode project, "monitoring.Environment.xcodeproj" it would be nice to be able to set the app namespace in build.xml under the app.

Been trying to post an argument to build-cordova-ios.xml but without luck, dont know where to begin.. .

Is this something that could be done or is this the best way of doing it?

Thanks and best regards
Robert

bricemason
24 Feb 2013, 6:42 PM
@webdev13, try to modify this part of your build.xml:

<exec executable="ant">
<arg value="-buildfile" />
<arg value="${cordova.android.project}/build.xml" /> <arg value="debug" /> </exec> to this: <exec executable="ant.bat"> <arg value="-buildfile" /> <arg value="${cordova.android.project}/build.xml" />
<arg value="debug" />
</exec>

I was running into the same issue as you but when I ran this using the ant batch script, it worked. Give that a go,

Brice

webdev13
25 Feb 2013, 12:07 AM
@ bricemason
thankssssssssssssssssssss , its working !!! :D
phonegap is working , really thank you so much

bricemason
25 Feb 2013, 7:15 PM
@giorgio, your 'test6' handler looks correct. I created a project using the sencha touch default generated app and added the following button config to the main view:

{
xtype: 'button',
handler: function() {
}
}

Just to confirm, are you able to load your app in the android emulator? Is the only error you experience when you attempt to click one of those buttons?

You said your app shows the correct version of phonegap. How is that happening? Are you displaying the phonegap version using the phonegap api device class?

If you have any questions regarding how to use the loadUrl method, you'll have to look at the source code of the android version of the cordova library. If your project generated correctly, open up the file cordova-android.js in the root of your sencha touch project. The loadUrl method has pretty good comments which currently is the only sort of documentation on this.

If you're still having trouble, please post the complete view where that segmentedbutton lives.

Brice

bricemason
25 Feb 2013, 7:35 PM
@rob.n, when you modify the namespace in your cordova.properties file to something like this:

cordova.ios.project.namespace=monitoring.Environment.${cordova.ios.project.name} it doesn't create the xcode project naming convention you posted. It will still be the name of your sencha app. Are you referring to the cordova.ios.project.name property instead? Also if I'm understanding your question correctly, are you asking if you can specify these properties that are normally used in the properties file at build time? Brice rob.n 27 Feb 2013, 2:09 AM Hi and thanks for your reply! Its correct, this only creates my base namespace (com.foo.internal), its when i want to create my app specific namespace that i change ".sencha/app/sencha.cfg" "app.name=monitoring.Environment". This create my app specific namespace "com.foo.internal.monitoring.Environment". I could use multiple copies of sencha-cordova-builder with different namespaces and the "app.name" only contains the name (no prefix) but i want to avoid that. I found some trouble using this approach when building for Android, does not like the "." in "app.name=monitoring.Environment" so perhaps i need to make multiple copies of sencha-cordova-builder and config "cordova.properties" such as "cordova.ios.project.namespace=com.foo.internal.monitoring" and leave "app.name" to "Environment" (my app name) in ".sencha/app/sencha.cfg". Would be nice though to be able to specify a namespace as an argument in the app "build.xml". //Robert bricemason 27 Feb 2013, 2:05 PM Robert, I struggled with this when I first created the project. I went back and forth on whether to build in support for specifying a different property file as an argument to the android and ios build routines. Obviously I decided not to in the interest of getting something up and running that was effective and covered the best number of use cases. I am closer to thinking about refactoring this to support it. One thing for example that I'd like to do is be able to build my app for different versions of phonegap. Thanks for your feedback and I'm sorry the project in it's current state doesn't easily support your scenario. I will put this request in my queue and strongly consider it. Brice munder 28 Feb 2013, 4:07 AM Whom the gods would destroy, they first introduce to Sencha Touch. At least that's what I thought until I discovered your utility, which looks like it could yet save what remains of my sanity. However (isn't there always a 'however'?) when I run your utility it informs me that: [INF] [exec] Missing one of the following: [INF] [exec] JDK: http://java.oracle.com [INF] [exec] Android SDK: http://developer.android.com [INF] [exec] Apache ant: http://ant.apache.org [ERR] [exec] Result: 1 They are in fact all on my system (windows 8 Pro 64 bit) and all referenced in the PATH variable. I have verified each with "where xxx" and get the following: java: C:\Windows\System32\java.exe C:\Program Files\Java\jdk1.7.0_10\jre\bin\java.exe C:\Program Files\Java\jdk1.7.0_15\bin\java.exe ant: C:\apache-ant-1.8.4\bin\ant C:\apache-ant-1.8.4\bin\ant.bat C:\apache-ant-1.8.4\bin\ant.cmd android: c:\AndroidDevelopment\sdk\tools\android.bat I'm using phonegap-2.3.0 downloaded from http://phonegap.com/download/ Sorry to bug you with this. But if you have any advice as to what I'm doing wrong, I'd be very grateful. Thanks. bricemason 28 Feb 2013, 2:01 PM @munder, No apologies necessary, I'm glad you're trying out the tool and I'm happy to help. That error is coming from the create.bat script in the phonegap library. Here is the snippet of what it's testing for: @ECHO OFF IF NOT DEFINED JAVA_HOME GOTO MISSING FOR %%X in (java.exe javac.exe ant.bat android.bat) do ( SET FOUND=%%~$PATH:X
IF NOT DEFINED FOUND GOTO MISSING
)
cscript "%~dp0\create.js" %*
GOTO END
:MISSING
ECHO Missing one of the following:
ECHO JDK: http://java.oracle.com
ECHO Android SDK: http://developer.android.com
ECHO Apache ant: http://ant.apache.org
EXIT /B 1
:END

Assuming you have java.exe, javac.exe, ant.bat, and android.bat in your PATH, the only missing thing could be the JAVA_HOME environment variable. Could you check to verify that you have an environment variable named JAVA_HOME that is pointing to the root of your JDK installation?

Brice

munder
28 Feb 2013, 4:37 PM
Of course! I swear I just get dafter. Thank you so much, Brice.

kramprabhu
1 Mar 2013, 5:51 AM
Hi

[INF] [echo] android project D:\sencha\hello\build\hello\android
[INF] [echo] android project built state...false
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: one or more of the resources required to initialize the android project cannot be resolved

What I am missing here..
I have Java, android and ant in my PATH.
I dont know 'D:\sencha\hello\build\hello\android' it is looking for. Is that folder I am missing?

-Ram

webdev13
2 Mar 2013, 4:12 AM
hi again Brice , i have question (i'm sorry if its wrong question), how i an add plugins to build , for example i want to use push notification message for android application , and confuse how to use it
best regards

kramprabhu
3 Mar 2013, 4:45 AM
D:\sencha\hello>sencha app build native
Sencha Cmd v3.0.0.250
[INF] init-properties:
[INF] init-sencha-command:
[INF] init:
[INF] -before-app-build:
[INF] app-build-impl:
[INF] native:
[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]
[INF] [shellscript] D:\sencha\hello\resources\sass>compass compile --boring --force
[INF] [shellscript] identical ../css/app.css
[INF] -after-sass:
[INF] page:
[INF] -before-page:
[INF] -page:
[INF] building application
[INF] Deploying your application to D:\sencha\hello\build\hello\package
[INF] Copied cordova-android.js
[INF] Copied app.js
[INF] Copied resources/css/app.css
[INF] Copied D:\sencha\hello\resources\icons
[INF] Copied D:\sencha\hello\resources\startup
[INF] Copied D:\sencha\hello\childbrowser
[INF] Resolving your application dependencies (file:///D:/sencha/hello/index.html)
[INF] Compiling app.js and dependencies
[INF] Processing classPath entry : D:\sencha\hello\sencha-compile-temp-dir
[INF] Processing classPath entry : D:\sencha\hello\touch\src
[INF] Processing classPath entry : D:\sencha\hello\app.js
[INF] Processing classPath entry : D:\sencha\hello\app
[INF] Processing class inheritance graph
[INF] Processing instantiation refereces to classes and aliases
[INF] Processing source dependencies
[INF] Concatenating output to file D:\sencha\hello\build\hello\package\app.js
[INF] Completed compilation.
[INF] Processed local file cordova-android.js
[INF] Minified cordova-android.js
[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] Packaging your application as a native app to D:\sencha\hello\build\native ...
[INF] Successfully packaged native application
[INF] Package may be run with 'sencha package run -p D:\sencha\hello\.\packager.temp.json
[INF] Successfully deployed your application to D:\sencha\hello\build\hello\package
[INF] -after-page:
[INF] -build:
[INF] -after-build:
[INF] build:
[INF] -after-app-build:
[INF] app-build:

Hi Brice

My build is success.. it works fine in chrome browser too.
But when I install .apk file to my andriod device then it just blinks 3 dot screen.

This happen when I include cordava.js file.

Any help

kramprabhu
3 Mar 2013, 4:47 AM
Hi Webdev13

Can you send me you sample app developed integrating PhoneGap. Let me test it in my box.
-Ram

webdev13
3 Mar 2013, 7:28 AM
do u need apk ?

munder
3 Mar 2013, 8:14 AM
Hello, Brice
I hope you don't mind me imposing on you, but I've spent the last few decades googling and searching Sencha forums and ploughing through the alleged documentation to no avail and so now turn to you as one who knows his Sencha Touch stuff, unlike so many of us flailing around in these forums.

Here's the problem:
My app works fine in Chrome in development, testing and production versions. If I run your sencha-cordova builder, I can run the app with no problem in Chrome from the generated assets/www directory.
Unfortunately, whether I use the apk generated by your builder, that generated by Sencha Cmd's native builder or debug from eclipse, whether to a hardware device or an emulator, I can't get past the app's loading screen in Android 4.x. I can on my phone using 2.3.5 (where the app doesn't run as it should, but getting past the loading screen is progress).

This is a problem raised over and over on the forum and there's even a youTube video demonstrating it. According to this thread : http://www.sencha.com/forum/showthread.php?162322-Sencha-Touch-2-PhoneGap-are-not-working-on-Android-4 it's fixed. Not for me.

I started learning ST in order to avoid having to learn Objective C, but I think that by now I could have written it in Java and learnt Objective C as well. I should be receiving a secondhand Mac tomorrow and will see how I get on with that. If ST runs OK on the Mac, then, unless you know of a solution, I guess I'll just write the Android version in native code. If it doesn't run on the Mac, maybe I'll just drop ST and try Titanium.

Edit:
I've just noticed that I'm raising the same issue as kramprahu above. So it's obviously not fixed for him either.

kramprabhu
3 Mar 2013, 8:30 AM
Hi Bric

I missed following line in build.xml
"<target name="-after-build" depends="-build-android" />"

After that.. I get following error...

[INF] [echo] checking android initialization using the followingresources:
[INF] [echo] cordova library D:phonegap-2.4.0
[INF] [echo] android tools D:phonegap-2.4.0\lib\android\bin
[INF] [echo] android create script D:phonegap-2.4.0\lib\android\in\\create.bat
[INF] [echo] android project D:\sencha\hello\build\hello\android
[INF] [echo] android project built state...false
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: one or more of the resoures required to initialize the android project cannot be resolved
[ERR] at com.sencha.exceptions.BasicException.wrap(BasicExcepion.java:43)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:104)
[ERR] at com.sencha.cli.Commands.dispatch(Commands.java:49)

I have ant, java and android sdk installed and with path specified.

webdev13
3 Mar 2013, 9:24 AM
i just installed the test app on my android mobile , and its working fine , please find the apk file here http://leads-map.com/test3-debug.zip

i hope i can help you more , but im sure Brice willing to help you all cuz he helped me a lot

regards

kramprabhu
3 Mar 2013, 8:11 PM
Hi Webdev13

I am still getting the build error. (pasted the error in previous post). I followed all the steps mentioned.. but still getting the error. I am developing in windows machine.
Help me .. if you find any thing in my error message.

-Ram

kramprabhu
3 Mar 2013, 8:48 PM
Hi Brice

When I am following another tuturioal of yours to integerage PhoneGap .. I get following error

D:\sencha\hello\build\hello\android>ant debug && adb install -r ./bin/test-debug.apk
Buildfile: D:\sencha\hello\build\hello\android\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 20.0.3
[checkenv] Installed at C:\Program Files\Android\android-sdk

-setup:
[echo] Project Name: hello
[gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-build-setup:
[echo] Resolving Build Target for hello...
[gettarget] Project Target: GALAXY Tab Addon
[gettarget] Vendor: Samsung Electronics Co., Ltd.
[gettarget] Platform Version: 2.2
[gettarget] API level: 8
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: D:\sencha\hello\build\hello\android\bin\res
[mkdir] Created dir: D:\sencha\hello\build\hello\android\gen
[mkdir] Created dir: D:\sencha\hello\build\hello\android\bin\classes
[echo] ----------
[echo] Resolving Dependencies for hello...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on

-pre-build:

-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:20: error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android'
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:22: error: No resource identifier found for attribute 'xlargeScreens' in package 'android'
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:49: error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android'
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:52: error: Error: String types not allowed (at 'configChanges' with value 'orientation|keyboardHidden|keyboard|screenSize|locale').

BUILD FAILED
C:\Program Files\Android\android-sdk\tools\ant\build.xml:621: The following erro
r occurred while executing this line:
C:\Program Files\Android\android-sdk\tools\ant\build.xml:657: null returned: 1

Total time: 1 second
'adb' is not recognized as an internal or external command,
operable program or batch file.

-Ram

webdev13
3 Mar 2013, 9:39 PM
make sure u add like the following to ur path
C:\Program Files (x86)\Android\android-sdk\tools;C:\Program Files (x86)\Android\android-sdk\platform-tools;C:\Program Files\Java\jdk1.7.0_15\bin

kramprabhu
3 Mar 2013, 10:49 PM
Hi Brice / Webdev13

I missed the platform-tools path.. now the adb command is working.. but some other error now.. sorry for bothering too much

D:\sencha\hello\build\hello\android>ant debug && adb install -r ./bin/hello-debug.apk
Buildfile: D:\sencha\hello\build\hello\android\build.xml

-set-mode-check:

-set-debug-files:

-check-env:
[checkenv] Android SDK Tools Revision 20.0.3
[checkenv] Installed at C:\Program Files\Android\android-sdk

-setup:
[echo] Project Name: hello
[gettype] Project Type: Application

-set-debug-mode:

-debug-obfuscation-check:

-build-setup:
[echo] Resolving Build Target for hello...
[gettarget] Project Target: GALAXY Tab Addon
[gettarget] Vendor: Samsung Electronics Co., Ltd.
[gettarget] Platform Version: 2.2
[gettarget] API level: 8
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for hello...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
[dependency] API<=15: Adding annotations.jar to the classpath.
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on

-pre-build:

-code-gen:
[mergemanifest] Found Deleted Target File
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:20: error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android'
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:22: error: No resource identifier found for attribute 'xlargeScreens' in package 'android'
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:49: error: No resource identifier found for attribute 'hardwareAccelerated' in package 'android'
[aapt] D:\sencha\hello\build\hello\android\bin\AndroidManifest.xml:52: error: Error: String types not allowed (at 'configChanges' with value 'orientation|keyboardHidden|keyboard|screenSize|locale').

BUILD FAILED
C:\Program Files\Android\android-sdk\tools\ant\build.xml:621: The following error occurred while executing this line:
C:\Program Files\Android\android-sdk\tools\ant\build.xml:657: null returned: 1

Total time: 1 second
can't find './bin/hello-debug.apk' to install

-Ram

webdev13
3 Mar 2013, 11:05 PM
im trying to help , and i hope i can .
please make that you have installed everything , open command line and type ant , android , java , adb , check that everything is working please , then see in the thread how build.xml should be look like .

kramprabhu
4 Mar 2013, 9:34 AM
Hi Webdev13

I have all command working at my windows ..but still the same error

[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] [echo] checking android initialization using the following
resources:
[INF] [echo] cordova library D:phonegap-2.2.0
[INF] [echo] android tools D:phonegap-2.2.0\lib\android\bin
[INF] [echo] android create script D:phonegap-2.2.0\lib\android\b
in\\create.bat
[INF] [echo] android project D:\sencha\hello\build\hello\android
[INF] [echo] android project built state...false
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: one or more of the resourc
es required to initialize the android project cannot be resolved
[ERR] at com.sencha.exceptions.BasicException.wrap(BasicExcept
ion.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(AbstractComma
nd.java:182)

Dont know how to proceed further.
-Ram

webdev13
4 Mar 2013, 9:59 AM
someone in the thread had problem like urs , go to page # 3 , and read Brice answer please

munder
5 Mar 2013, 3:13 AM
Good news, Brice. I changed the reference to source in my app.json file from touch/sencha-touch.js to touch/sencha-touch-all.js and was then, debugging from eclipse, able to get past the loading screen. There are problems once I get past that, but it's progress of a sort.

kramprabhu
6 Mar 2013, 7:38 AM
Hi Brice / Webdev13

Good news is that after switching to Mac environment .. build package is working fine.

I get both iOS and Android simulator showing it fine.

But when I do build native.. some conflict in the packing the files

I have configured packager.json to use Android.. but when doing build native.. it picking cordova_ios.js instead of cordova_android.js file.

Pasting the app.json file packed in .apk

{"id":"5a97e071-eebe-4b31-be6b-0dab1203ac26","js":[{"path":"cordova-ios.js","type":"js"},{"bundle":true,"path":"app.js",
"update":"delta","type":"js"}],"css":[{"path":"resources/css/app.css","update":"delta","type":"css"}]}

Regards
-Ram

shaileshelan
8 Mar 2013, 5:41 AM
Hi Brice,

I am building app with sencha touch 2.1 and phonegap 2.2 on window 7 using you tutorial. I am able to build app but android folder is not generating on given path. All command (java, javac, android, ant) all are working on my cmd. See my attached log of build command. Please guide me.

42263
Thanks,
shailesh

invincible007
12 Mar 2013, 12:01 PM
Hi,

I am using sencha cordova builder to build xcode project native app for my application. I am stuck at following error when I execute "sencha app build package" command in terminal.

I am using cordova-2.4.0, sencha 2.x. Can some please help me with this?

Successfully deployed your application to /Users/ngarach/Documents/inetpub/wwwroot/Mobile/Apps/MobileCompanion/Source/build/MobileCompanion/package
[INF]
[INF] -after-page:
[INF]
[INF] run:
[INF]
[INF] -build:
[INF]
[INF] -check-os:
[INF]
[INF] -make-unix-property-paths:
[INF]
[INF] -make-windows-property-paths:
[INF]
[INF] -init-properties:
[INF]
[INF] -is-ios-built:
[INF]
[INF] -set-windows-create-script:
[INF]
[INF] -set-unix-create-script:
[INF]
[INF] [echo] checking ios initialization using the following resources:
[INF] [echo] cordova library /Users/ngarach/Documents/cordova-2.4.0/cordova-ios
[INF] [echo] ios tools /Users/ngarach/Documents/cordova-2.4.0/cordova-ios/bin
[INF] [echo] ios create script /Users/ngarach/Documents/cordova-2.4.0/cordova-ios/bin/create
[INF] [echo] ios project /Users/ngarach/Documents/inetpub/wwwroot/Mobile/Apps/MobileCompanion/Source/build/MobileCompanion/ios
[INF] [echo] ios project built state...false
[INF]
[INF] -before-init-ios-internal:
[INF]
[INF] -before-init-ios:
[INF]
[INF] -init-ios-internal:
[INF] [echo] initializating ios build...
[INF] [echo] creating ios project with the following details:
[INF] [echo] project path: /Users/ngarach/Documents/inetpub/wwwroot/Mobile/Apps/MobileCompanion/Source/build/MobileCompanion/ios
[INF] [echo] project namespace: com.example.MobileCompanion
[INF] [echo] project name: MobileCompanion
[INF] [echo] ios project successfully created at /Users/ngarach/Documents/inetpub/wwwroot/Mobile/Apps/MobileCompanion/Source/build/MobileCompanion/ios
[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.io.FileNotFoundException: File '''/Users/ngarach/Documents/cordova-2.4.0/cordova-ios/VERSION''' does not exist (<Unknown source>#3) in <Unknown source> at line number 3
[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 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:57)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERR] at java.lang.reflect.Method.invoke(Method.java:601)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
[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:94) [ERR] at com.sencha.command.BasePluginCommands$BasePluginCommand.run(BasePluginCommands.java:98)
[ERR] at com.sencha.command.BasePluginCommands$BaseNamePathCommand.run(BasePluginCommands.java:142) [ERR] at com.sencha.command.app.AppCommands$BuildCommand.execute(AppCommands.java:116)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERR] at java.lang.reflect.Method.invoke(Method.java:601)
[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/ngarach/Documents/sencha-cordova-builder/build-cordova-ios.xml:60: javax.script.ScriptException: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.io.FileNotFoundException: File '''/Users/ngarach/Documents/cordova-2.4.0/cordova-ios/VERSION''' does not exist (<Unknown source>#3) in <Unknown source> at line number 3
[ERR] at org.apache.tools.ant.util.ReflectUtil.toBuildException(ReflectUtil.java:183)
[ERR] at org.apache.tools.ant.util.ReflectUtil.throwBuildException(ReflectUtil.java:166)
[ERR] at org.apache.tools.ant.util.ReflectUtil.invoke(ReflectUtil.java:110)
[ERR] at org.apache.tools.ant.util.ReflectWrapper.invoke(ReflectWrapper.java:81)
[ERR] at org.apache.tools.ant.util.optional.JavaxScriptRunner.evaluateScript(JavaxScriptRunner.java:103)
[ERR] at org.apache.tools.ant.util.optional.JavaxScriptRunner.executeScript(JavaxScriptRunner.java:67)
[ERR] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[ERR] at sun.reflect.GeneratedMethodAccessor10.invoke(Unknown Source)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERR] at java.lang.reflect.Method.invoke(Method.java:601)
[ERR] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[ERR] at org.apache.tools.ant.Target.execute(Target.java:392)
[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:57)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERR] at java.lang.reflect.Method.invoke(Method.java:601)
[ERR] at com.sencha.cli.Command.dispatch(Command.java:78)
[ERR] ... 31 more
[ERR] Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.io.FileNotFoundException: File '''/Users/ngarach/Documents/cordova-2.4.0/cordova-ios/VERSION''' does not exist (<Unknown source>#3) in <Unknown source> at line number 3
[ERR] at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:224)
[ERR] at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:240)
[ERR] at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERR] at java.lang.reflect.Method.invoke(Method.java:601)
[ERR] at org.apache.tools.ant.util.ReflectUtil.invoke(ReflectUtil.java:108)
[ERR] ... 55 more
[ERR] Caused by: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.io.FileNotFoundException: File '''/Users/ngarach/Documents/cordova-2.4.0/cordova-ios/VERSION''' does not exist (<Unknown source>#3)
[ERR] at sun.org.mozilla.javascript.internal.Context.throwAsScriptRuntimeEx(Context.java:1798)
[ERR] at sun.org.mozilla.javascript.internal.MemberBox.invoke(MemberBox.java:196)
[ERR] at sun.org.mozilla.javascript.internal.NativeJavaMethod.call(NativeJavaMethod.java:245)
[ERR] at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:1706)
[ERR] at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:849)
[ERR] at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:162)
[ERR] at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:429)
[ERR] at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:116) [ERR] at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:109)
[ERR] at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
[ERR] at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(InterpretedFunction.java:173)
[ERR] at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.java:214)
[ERR] ... 62 more
[ERR] Caused by: java.io.FileNotFoundException: File '''/Users/ngarach/Documents/cordova-2.4.0/cordova-ios/VERSION''' does not exist
[ERR] at org.apache.commons.io.FileUtils.openInputStream(FileUtils.java:299)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[ERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[ERR] at java.lang.reflect.Method.invoke(Method.java:601)
[ERR] at sun.org.mozilla.javascript.internal.MemberBox.invoke(MemberBox.java:167)
[ERR] ... 73 more
[ERR]
[ERR] Total time: 12 seconds
[ERR] com.sencha.exceptions.BasicException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.WrappedException: Wrapped java.io.FileNotFoundException: File '/Users/ngarach/Documents/cordova-2.4.0/cordova-ios/VERSION' does not exist (<Unknown source>#3) in <Unknown source> at line number 3

23 Apr 2013, 11:50 AM
I love your ant build tool, saves me a ton! However if I understand it correctly it only takes me as far as creating a Xcode app for testing. (Yes, using this for IOS). I run sencha app build testing and it creates an xcode project in the ios directory of the build directory which is perfect!

However is that as far as I can go? Can your build tool create an .app or .ipa file?

Thanks!

Scorpie
1 May 2013, 1:08 PM
However is that as far as I can go? Can your build tool create an .app or .ipa file?

Thanks!

Nope. It will create a barebone project, not package it.

samuel5_89
4 May 2013, 7:04 AM
Hi Brice!

First of all, congratulations for your great work!

I'm using Sencha Cordova Builder for 2 weeks and now I have a problem...

I'm using a calendar plugin on my app (Ext.ux.TouchCalendar, available on: https://market.sencha.com/extensions/ext-ux-touchcalendar) that requires a few css files.

Everything is working perfectly, but when I build the app and test it in my tablet, the calendar doesn't display correctly like if the required calendar css files aren't imported.

So I checked the folder
\build\MyApp\android\assets\www\resources and those required calendar css files arent there, in spite of making all the imports in my index.html.

Am I making those imports incorrectly?

Sorry for my english.

Thank you very much.

Best Regards,
Samuel.

samuel5_89
4 May 2013, 12:21 PM
Never mind, I fixed the problem by adding manually the css files to the specified folder before building to android.

Hi Brice!

First of all, congratulations for your great work!

I'm using Sencha Cordova Builder for 2 weeks and now I have a problem...

I'm using a calendar plugin on my app (Ext.ux.TouchCalendar, available on: https://market.sencha.com/extensions/ext-ux-touchcalendar) that requires a few css files.

Everything is working perfectly, but when I build the app and test it in my tablet, the calendar doesn't display correctly like if the required calendar css files aren't imported.

So I checked the folder
\build\MyApp\android\assets\www\resources and those required calendar css files arent there, in spite of making all the imports in my index.html.

Am I making those imports incorrectly?

Sorry for my english.

Thank you very much.

Best Regards,
Samuel.

kkarnayil
9 May 2013, 9:29 PM
Hey,
i am building my sencha touch 2 app using sencha cordova and Phone gap 2.2.
I changed path of framework in cordova properties file and also added the following line in build.xml

<import file="D:/apache-tomcat-6.0.36-windows-x86/apache-tomcat-6.0.36/webapps/HealthWallPOCClient/sencha-cordova-builder-master/build-cordova.xml"/>
<target name="-after-build" depends="-build-android"/>

and i am getting the following error when i use cmd sencha app build package

[INF] [echo] checking android initialization using the following resources:

[INF] [echo] cordova library D:\PhoneGap
[INF] [echo] android tools D:\PhoneGap\lib\android\bin
[INF] [echo] android create script D:\PhoneGap\lib\android\bin\\create.bat
[INF] [echo] android project D:\apache-tomcat-6.0.36-windows-x86\apache-tom
cat-6.0.36\webapps\HealthWallPOCClient\build\HealthWallPOCClient\android
[INF] [echo] android project built state...false
[INF]
[INF] -before-init-android-internal:
[INF]
[INF] -before-init-android:
[INF]
[INF] -init-android-internal:
[INF] [echo] initializating android build...
[INF] [echo] creating android project with the following details:
[INF] [echo] project path: D:\apache-tomcat-6.0.36-windows-x86\apache-tomca
t-6.0.36\webapps\HealthWallPOCClient\build\HealthWallPOCClient\android
[INF] [echo] project namespace: com.example.HealthWallPOCClient
[INF] [echo] project name: HealthWallPOCClient
[INF] [exec] Missing one of the following:
[INF] [exec] JDK: http://java.oracle.com
[INF] [exec] Android SDK: http://developer.android.com
[INF] [exec] Apache ant: http://ant.apache.org
[ERR] [exec] Result: 1
[ERR]
[ERR] BUILD FAILED
[ERR] com.sencha.exceptions.BasicException: D:\apache-tomcat-6.0.36-windows-x86\
apache-tomcat-6.0.36\webapps\HealthWallPOCClient\build\HealthWallPOCClient\andro
id does not exist.

Rexroth4Sencha
16 May 2013, 7:35 AM
I'm using the Sencha Cordova Builder with phonegap-2.5.0 and Win7. The build is running fine (btw. great job Brice Mason (http://vimeo.com/bricemason)!)
My problem is, when I run my Android App I get a reference error because cordova is not defined. In my app.json file (in the generated Android project) I can find "path":"cordova-android.js" as expected. The file is also available.
The app is working fine, if I add "<script type="text/javascript" src="cordova-android.js"></script>" manually to index.html.
Where is my fault?

David

samuel5_89
19 May 2013, 5:19 PM
Hi all.

I'm using Sencha Cordova Builder to develop an app to iOS and Android. But when I build the application, the name of the created apk is "MyApp-debug.apk".
Am I supposed to change any configuration?

Thank you.

harleyflh75
31 May 2013, 8:19 AM
First off, thank you very much for the tool.

This problem pertains to my main project, but i decided to do a test case by starting a brand new project from scratch.
i have the latest version of sencha-cordova-builder as well as sencha cmd v 3.1, cordova v 2.6, phonegap v2.4, and sencha v2.1.1
i built a new app with sencha generate app which worked fine.
modified the cordova.properties file as per the screencast.
then i opened the build.xml file and added both the import of build-cordova.xml and target -after-build with -build-cordova-all
then i ran sencha app build package
i moved the contents of the package folder to a webserver and tried to access it from the browser on my phone....the blue loading screen with white dots is the only thing that shows and there are no errors.
I have even tried to use the assets/www folder in the android build and the www folder in the ios build to no avail.

If I repeat the process but skip adding the 2 nodes to the build.xml file, the browser serves up the site correctly.

Is this as intended? or am I missing something

kodak
31 Jul 2013, 2:50 PM
@harleyflh75
I have the same issue that I cannot access the phonegap build with a webbrowser. I think the problem is that the cordova lib is not able to load if you dont run it on a device... My solution is that I just have to build, one for native and one for web without cordova.
But I would also be interested in a better solution.

And here is just a quick tipp I want to share:
I had to manually delete the _ios.built file befor every new "sencha app build package".
But its possible to modify the build.xml ant script like this:

build.xml

<target name="-after-clean">
<delete file="${build.dir}/_ios.built" /> </target> If you add those line after <target name="-after-build" depends="-build-ios" /> the _ios.built file gets deleted before every build... good_c_ryan_19 10 Sep 2013, 4:57 PM Good day Brice , Is there new update for Windows Build for iOS? I have been successfully created Android Build on Windows but failed on iOS. Im using sencha compilier to create iOS native on Windows 7 but im not enable to integrate phonegap on my App. I got this error below: 45748 Thanks and Regards LucasRochaBR 21 Sep 2013, 5:11 PM win 7 , sencha 2.2.1 , cordova2.9, sencha cmd 3.1.*, latest sencha touch builder(downloaded 19/09/2013) hello all, after run > sencha app build package i go to C:\sencha\apps\my-app2\build\MyApp2\android\cordova> and hit build then i got the end of the executed scripted > [mkdir] Created dir: C:\sencha\apps\my-app2\build\MyApp2\android\bin [mkdir] Created dir: C:\sencha\apps\my-app2\build\MyApp2\android\bin\res [mkdir] Created dir: C:\sencha\apps\my-app2\build\MyApp2\android\bin\rsObj [mkdir] Created dir: C:\sencha\apps\my-app2\build\MyApp2\android\bin\rsLibs [mkdir] Created dir: C:\sencha\apps\my-app2\build\MyApp2\android\gen [mkdir] Created dir: C:\sencha\apps\my-app2\build\MyApp2\android\bin\classes C:\sencha\apps\my-app2\build\MyApp2\android\cordova\lib\cordova.js(610, 1) Micro soft JScript runtime error: 'cordova' is undefined with thar my APK is no generated Help me please tanx anxin 27 Nov 2013, 11:36 PM I used cordova 2.9.0, in this version, the cordova.js has no version in its name,so I changed such code: <property name="cordova.android.tools.js" value="${cordova.android.project.www}/cordova-${cordova.lib.version}.js" /> in the build-cordova-android.xml into: <property name="cordova.android.tools.js" value="${cordova.android.project.www}/cordova.js" />

and it worked!but, when it is going to update app.json file, add the cordova-android.js to it,it went wrong:

[INF] -before-init-android-internal:[INF]
[INF] -init-android-internal:
[INF]
[INF] -after-init-android-internal:
[INF]
[INF] -init-android:
[INF]
[INF] -before-build-android-internal:
[INF]
[INF] -before-build-android:
[INF]
[INF] -build-android-internal:
[INF] [echo] building android...
[INF] [echo] backing up app.json to app.json.bak
[INF] [echo] app.json was backed up successfully
[INF] [echo] modifying app.json to include E:\project\transport\cordova-and
roid.js javascript
[INF]
[INF] -modify-app-json:
[ERR] The following error occurred while executing this line:
E:\project\sencha-cordova-builder\build-cordova-android.xml:90: The following er
ror occurred while executing this line:
E:\project\sencha-cordova-builder\util-cordova.xml:24: javax.script.ScriptExcept
ion: sun.org.mozilla.javascript.internal.WrappedException: Wrapped org.json.JSON
Exception: Missing value at character 735 (<Unknown source>#28) in <Unknown sour
ce> at line number 28

can any one help me?