Using Sencha Cmd with an existing app

nahl picture nahl · Apr 25, 2013 · Viewed 11.3k times · Source

I created a theme using the sencha cmd on a dummy app and now I want to use that theme on other applicattion. I've copied the theme folder to my app's packages folder and it's working fine.

I made some changes so I tried to use "sencha package build" to compile the theme and got this error:

[ERR] null
at com.sencha.command.environment.PackageEnvironment.loadBaseConfigs(PackageEnvironment.java:64)
at com.sencha.command.environment.PackageEnvironment.<init>(PackageEnvironment.java:46)
at com.sencha.command.environment.BuildEnvironment.load(BuildEnvironment.java:166)
at com.sencha.command.Sencha.loadBuildEnvironment(Sencha.java:361)
at com.sencha.command.Sencha.<init>(Sencha.java:67)
at com.sencha.command.Sencha.<init>(Sencha.java:61)
at com.sencha.command.Sencha.main(Sencha.java:106

I thought the error was related to the theme but I also get this if I try to execute a sencha command from my app folder:

[ERR] Command must be run from an application folder

Obviously it's some kind of misconfiguration but I have no idea how to solve it. Any suggestions?

Edit: I've generated a new app with sencha cmd and copied the code from the old app to the new one. Now it's not building:

BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: com.sencha.exceptions.ExParse: Failed parsing path/ext-all-rtl-sandbox-debug-w-comments.js
[ERR]   at
[ERR]  org.mozilla.javascript.ast.FunctionNode.visit(FunctionNode.java:421)

Is there a way to compile the theme without using the cmd on ExtJs 4.2?

Answer

cg_coder picture cg_coder · Aug 8, 2013

Actually, the issue with this error is that when you unzip the library, make sure you don't play around with the directory structure and/or content.

Basically in the sencha.cfg file, you will find the following entries

app.framework.version=4.2.1.883 app.cmd.version=3.1.2.342

Initially, my extjs library was under extjs421, which was the root of the library as I hate to have a directory within a directory and no other content.

I was able to generate the app, but, couldn't do a build.

So, I took my zip file and unzipped it, but left it intact, no renaming and/or content shuffling.

sencha --sdk ext-4.2.1-ent/ext-4.2.1.883 generate app Blah myBlah I modified the sencha.cfg file to have the neptune theme I did sencha app build

worked like a charm, no errors

Cheers!