Ext JS 4: Sencha CMD issues - extjs

Ok, I've been trying and trying my hardest to build a simple application with the Sencha CMD tool. I've tried this with versions 4.0.7 (located on Sencha website), 4.1.0 (here), 4.1.1 (here), and 4.2.1 (Sencha website) with varying results but no success. When I issue the commands:
sencha -sdk extjs-4.0.7 generate workspace ext407
sencha -sdk extjs-4.1.0 generate workspace ext410
sencha -sdk extjs-4.1.1 generate workspace ext411
I get a directory with only the empty directory packages. As I've read the documentation, my directories should have ext and packages. When I issue sencha -sdk ext-4.2.1.883 generate workspace ext421, I get the proper folders. However, when I take the next step:
cd ext421
sencha -sdk ext generate app ThemeDemoApp appDemo
per the Theming Guide, it appears to fail, even though I get my ext421 directory. I say it appears to fail because this is the error I get:
[INF] Loading classpath entry /var/www/html/applications/web/ext421/ext/src
/home/ec2-user/bin/Sencha/Cmd/3.1.2.342/sencha: line 58: 19461 Killed
java $jvmArgs -jar $BASEDIR/sencha.jar "$#"
And it looks like my sass/config.rb is a bit unfinished...
cur_dir = File.dirname(__FILE__)
output_style = :nested
I'm running Ruby 1.9.3, Sencha CMD 3.1.2.342, and Java 1.7.0_25. I'm also on a 64-bit Amazon Linux AMI instance.
I'm so confused what the problem is... I have this working on my work laptop (Mac OSX Lion), but I cannot figure out what I'm doing wrong on my ec2 instance. Any help would be greatly appreciated!
Cross posted from Sencha forums.

I have no idea what I did, but I diffed sencha and sencha-3.1.2.342... the only difference was the end of the file, indicating that the sencha binary did not have a newline at the end. I did a hexdump on both of the files, and sure enough, it did not. I edited the file and added one by just hitting return at the end of the file. This seemed to make the file happy.
Now, I've gone back and removed this newline, and the file still runs. Baffling. I have no idea why it's working... I even went back and re-ran the installer, now it works. Maybe I'm just going crazy?
There's been a great deal of discussing this topic in the Sencha thread I started... it kind of sounds like Java is running out of memory, but we're not 100% sure on this diagnosis. If someone comes up with a better answer, I'll mark that.

Why do you need to generate workspaces and applications on EC2 instance? Use source control repository instead, generate the files once on your laptop and check them in so you don't have to repeat this every time
Sencha Cmd is compatible with Ext JS 4.1.1a+ and 4.2.x, so no luck with other versions
Not quite sure about Ruby compatibility issues, their versioning system is weird; in Linux Cmd worked for me with Ruby 1.8.7.

Related

Sencha Studio tests on Windows 10 neither run in IDE nor via CLI

I'm new to Sencha and so for Sencha Test. On my Windows 10 machine I installed the latest Sencha Studio and imported a sample project for ours. Following tutorials I created a test suite with the sample "it should pass 1 = 1" test. But I cannot run this test, neither via IDE nor CLI.
On the scenario I selected my local Chrome browser and the sample test. When I click on RUN, the browser selection on the right gets updated with gray bullets or void but nothing else happens. Changing the scenario's test type to "Webdriver" or "In-browser" does not change anything in regard for the outcome.
I also tried to execute the test via CLI but no success either. I always end up with this message: "Sencha Test v2.0.2Error: Sencha Cmd install directory not found : C:\Users[MY_PROFILE]\bin\Sencha\Cmd." That's right, my Sencha Cmd installation is located in C:\dev\Sencha\Cmd and works properly. Where's the configuration to change that stc can find Sencha Cmd?
Any hints how to get the tests run? Is an archive server mandatory to run the tests? Is there anything that I might have missed? Using Google was no help so far.
Maybe that's helpful: The Event Recorder does also not work properly. When I click on recording, my Chrome does not get opened, I have to open it by myself and navigate to the URL provided by Sencha Studio. Weird.
Thanks in advance.
After several hours of thinking and searching I think the most critical error was to NOT install Sencha Cmd and Sencha Test into the installer's recommended folder. I still have issues when starting tests but I'll post an answer if there's anything interesting about this topic.
Also, it seems that Sencha Test always expects that a built project exists. So just checking out the sources without building them is not sufficient to run tests, even if you're testing e.g. the staging.

Sencha Cmd won't build on another workstation

So I am trying to set up another ExtJS (4.2.1) dev workstation I've got Ruby 1.9.3, Sencha Cmd 4.0.4.84 installed and latest Java VM too.
The build won't work on this one though, I'm getting:
[INF] executing compass using system installed ruby runtime
Errno::ENOENT on line ["38"] of C: No such file or directory - C:/devtfs/CustomerPortal/CustomerPortal.UI/Content/Customer_Portal_UI/build/temp/production/Customer_Portal_UI/slicer-temp/.sass-cache/82daaa66b7a4761963814fd25131bf0f81370ec9/Customer_Portal_UI-example.scssc
82daaa66b7a4761963814fd25131bf0f81370ec9 folder does exist, but it's empty.
I've tried
sencha ant clean
sencha app refresh
sencha app build --clean
No go. Ever seen this issue ?
Thanks!
EDIT: Hmm, even after this error, the application seems to be running fine on the Sencha web server, but the index.html file is the last thing that's not created in build/production.

Enable Sencha Touch 2.2.1 Offline

I'm currently toying around with Sencha Touch 2.2.1 and am trying to get it to run offline using an HTML5 cache.manifest. Anyone know how to get this to work? I can only find old guides from the last version which no longer seem to work. After some fiddling I have my manifest as follows:
CACHE MANIFEST
index.html
app.js
touch/microloader/development.js
But this seems to throw errors in the development.js script when it attempts to send fetch the app.json file. Are there some Sencha settings I have to adjust for offline mode? Thank you for your help.
After some hunting around it seems this feature is present in Sencha Touch 2.0 but still a bit incomplete. To get it to work, do as follows:
You must have the Sencha command line installed (which you probably
already have since it's required to make a Sencha project in the
first place).
Navigate to your project's parent directory in command line
Use the sencha app build production command to "compile" your project into a single file
Navigate to your production directory in YourApp/build/YourApp/production
Chane the extension of cache.appcache to cache.manifest
Edit the index.html file's html tag so that manifest="cache.manifest"
Ensure your server is configured to serve .manifest files correctly
Now your production code should have a working cache manifest. Note you only need to change the extension so that the app works on iOS, it seems to work in browser (or at least Chrome where I tested this) with the .appcache extension.
Compiling to production appears to be the only way to generate a cache manifest file but you can use this same file in a testing build if you don't want all the code minified for debugging. Of course you'll have to copy your manifest over and ensure it's referenced in your testing build's html tag.
All in all Sencha clearly needs to update their documentation here but I'm glad I found this out. I only tested this with a super basic, static, two page application. Hoping it scales decently.
Instead of changing manually your production package, you should change in app.json lines after 'appCache'. Here is what will be generated by Sencha CMD and will work just fine after running sencha app build production.
You can see a live example here https://github.com/flrent/ConfMate/blob/master/app.json#L79

Installing Sencha Touch 2 framework

I've a problem with getting Sencha Touch to work. I'm using a MacBook Pro and it's really been a hell installing this framework. Sencha don't seem to have any documentation that fits the latest version of their product and there is no way for me to download an older version from their website. Therefore I need your help!
I've downloaded Sencha SDK, SDKTools and their Cmd-software. The version of the SDK is 2.1.1, the SDKTools is 2.0.0 and I dont know the version of the cmd-software. All three softwares is however the latest from Senchas webpage.
I've placed the SDK under the root of the web server, and I've also installed the SDKTools in the root.
This is the structure I'm currently using:
Root of webbserver:
- SDK
- SDKTools
The SDK works in the way that I can surf into it, by using my browser into the "SDK"-folder. On that page I can view examples of Sencha applications.
When I go the SDK folder via the Terminal, and type "Sencha" - I get the error:
[WARN] The current working directory (/Applications/MAMP/htdocs/SDK) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode.
I've googled this and tried the following actions:
1. Placed the SDKTools in the same folder as the SDK.
2. Created a systemfile named .senchasdk with the content "sdk".
3. Created a systemfile named .senchasdk with the content ".".
The first option, naturally doesn't work (didn't differ anything from the previous setup). The 2nd and 3rd action resulted in compilationerrors when typing Sencha in the SDK-folder. Example down below:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/Applications/MAMP/htdocs/SDK/command/sencha.js'
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
I've also tried typing "Sencha" from the SDKTools folder, but that doesn't work either. I don't know what this problem comes from and can't find any other solutions to solve this. Does anyone know? Or have any suggestions on solution or part of solution?
Sencha Touch 2.1 doesn't work with SDK Tools anymore. The documentation bundled with Sencha Touch 2.1 is not up-to-date. Here is the good documentation :
http://docs.sencha.com/touch/2-1/#!/guide/command
On their website, you can download the 2.0 version of the Sencha CMD tool which is used instead of SDKTools nowadays. However, if you use the 2.0 version you will meet nothing but trouble since that is outdated. The latest version as of right now is 3.1 and can only be downloadable from your account at support.sencha.com, and not from the download page when not logged in.

stbuild not found

I am trying to build native application for ios using sencha touch but every time I use packaging command it gives me error that stbuild in not an external and internal command.
I searched a lot on this problem but did not get any solution.
I had a same problem.
But it worked when I run SenchaSDKTools/stbuild.pkg.
like below:
/Applications/SenchaSDKTools-2.0.0-Beta/stbuild.pkg
Have you installed "Sencha SDK Tools"? If not, then you should install it.
You can also use the sencha command for native packaging of the application.
Like,
sencha package generate <configTemplate.json>
Sencha Touch 2 Native Packaging for Android
Sencha Touch 2 Native Packaging for iOS
If you have already installed the Sencha SDK Tools, the executable file stbuild.exe file will be installed into the windows system root folder (e.g. C:\Windows) while a subdirectory named stbuild will be installed in the same folder. Check to see if it is there. If it is not, it can be downloaded separately from http://dl.dropbox.com/u/8793605/stbuild.msi.
This can happen if the SenchaTouch installer goes awry. In my case the installer won't run on my Windows 7 system, so I duplicated it's effects manually from a Windows XP install.
NOTE: From my research it appears that from the version 2.1 tools onwards, the stbuild will be installed to the sencha tools location and no longer into the windows system directory (which is as it always should have been! - I don't know what they were thinking).

Resources