Using Sencha Cmd with an existing app
Asked Answered
T

2

7

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?

Tarrant answered 25/4, 2013 at 20:33 Comment(2)
Are you running the command from your application's folder?Chancery
Yes. The thing is someone else created this app. I know he used sencha cmd to generate it but maybe some files are missing. Is there a main config file or something that I should check?Tarrant
D
5

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!

Dipetalous answered 8/8, 2013 at 0:52 Comment(0)
B
1

The structure of these applications is the same? Ext versions? Look at sehcha.cfg file (yourAppFolder/.sencha/app/sencha.cfg). Changes may be needed.

Binocular answered 26/4, 2013 at 9:4 Comment(4)
Ok, this is it. I don't have a .sencha folder in the app. Is there any way to generate it without losing anything?Tarrant
A valid application directory is one that was generated by Sencha Cmd. I think you can try generate new app in another directory, and paste code from old app.Binocular
Thank you. Lets see how it goes.Tarrant
It didn't worked. I generated an app, builded it and it was working fine but as soon as I pasted the code from the old app the app build command stopped working. I've edited my first post with new error.Tarrant

© 2022 - 2024 — McMap. All rights reserved.