I am trying to create a new sencha touch app using "sencha generate app MyApp ../MyApp" command on Windows.
I have done the following :
Downloaded the latest sencha SDK and extracted it in folder "D:\MyProjects\sencha-touch-2.1.0-gpl" folder.
Installed the sencha SDK tools in "D:\MyProjects\SenchaSDKTools-2.0.0-beta3" folder.
Ensured that the system environment variable "SENCHA_SDK_TOOLS_2_0_0_BETA3" is indeed pointing to "D:\MyProjects\SenchaSDKTools-2.0.0-beta3"
As per the sencha documentation I am supposed to run the sencha command in the sencha SDK or application folder.
So if I cd to folder "D:\MyProjects\sencha-touch-2.1.0-gpl" and run "sencha generate app MyApp ../MyApp", I get this warning message
**"[WARN] The current working directory (D:\MyProjects\sencha-touch-2.1.0-gpl) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode."**
Why does not sencha recognize this as the SDK folder?
Looking at the code in "sencha.js" file included as part of the sdk tools, it seems that sencha is looking for a ".senchasdk" file.
So I tried the same command from one of the subfolders in the examples folder (since this folder contains a .senchasdk file)
Now I end up with an error
"node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module 'D:\MyProjects\sencha-touch-2.1.0-gpl\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)"
Since it seemed as if sencha was looking for a non existing folder called "command", I copied the contents of SDK tools folder to a new folder called "command" placed it under D:\MyProjects\sencha-touch-2.1.0-gpl\ folder.
Executing the sencha generate command, results in an infinite loop and a lot of Node.exe processes are spawned (observed via TaskManager).
Any help would be greatly appreciated.
I had the same problem and finally figured that Sencha Touch 2.1 is not longer using Sencha SDK Tools but using Sencha Command instead.
You can find more here :
http://docs.sencha.com/touch/2-1/#/guide/command
and here
http://docs.sencha.com/touch/2-1/#!/guide/command_app-section-2
Hope this helped
Try this...
Make sure three things..
Sencha touch installed path.
Application generating keyword
Where you going to save your Sencha touch project.
Lets create a project.
Open a command prompt
Type your Sencha touch sdk installed path. (For me: C:\inetpub\wwwroot\touch-2.3.1)
And type sencha generate app MyApp. here MyApp is our project name.
Then type the path where you going to save your project MyApp(For me: C:\inetpub\wwwroot\Poonguti\MyApp ).
press Enter.
Now, I hope you create a Sencha touch project.
here is an attached screen shot.
This is because, you are using the older version of SenchaCMD.
This can happen because of two reasons.
Reason 1
You installed SenchaCmd first and SenchaSDK second. This may override the latest version of SenchaCmd with older version, which is shipped with SenchaSDK.
Solution
Install SenchaSDK first and SenchaCmd last.
Reason 2
The path of SenchaCmd set on environment variable may be wrong. Please check this.
As TDeBailleul said, you don't need SenchaSDK for the latest version of SenchaTouch.
Just use SenchaCmd only.
I had the same issue. Finally, the problem was that I was using an old version of the sdk...
I would recenment to un installed version 2.0 and download and installed version 3.0.
Download Link
Install
sencha cmd
ruby
compasss
and Download sencha touch
extarct sencha touch and then type
sencha -sdk PATH TO TOUCH folder generate app APPNAME PROJECTPATH
Try navigating to the path where your sencha cmd got installed instead of sencha sdk folder
Open command propmt
cd C:\..\bin\Sencha\Cmd\4.0.2.67
Then type sencha and then press enter
You should get something like Sencha Cmd V4.0.2.67
my SDK is where i extracted my ExtJS files.
~/current/gaia/static/js/ext-5.1.1
you can generate workspace from within the folder like this:
sencha generate workspace /tmp/extJSworkSpace
or
you can specify it's location if you are not in the folder.
sencha -sdk ~/current/gaia/static/js/ext-5.1.1 generate workspace /tmp/extJSworkSpace
contents of the SDK folder looks like:
ls ~/current/gaia/static/js/ext-5.1.1
build cmd ext-bootstrap.js LICENSE overrides packages Readme.md src version.properties build.xml examples index.html licenses package.json plugins release-notes.html test welcome
if you don't specify -sdk flag and are not inside the folder, it will create the workspace still but there will be no 'ext' folder inside (not copied).
hope this helps.
Related
I am trying to run an update of an old Sencha Touch app using Sencha CMD, however when I try to run it from the App folder (which I assume is right due to it having all the requirements) I am getting an error returned:
"[ERR] Command must be run from an app folder"
Here's the contents of the folder where I am executing the command:
folder screenshot
"[ERR] Command must be run from an app folder"
This error means that .sencha folder is missing in directory, So check properly and add it.
you're not in the sencha app project folder inside. you need to run that command inside the sencha app folder.
To generate a Sencha Touch project from the command line tools, i followed the following steps as described in many forums and also in the official Sencha touch doc. But it couldn't find the generate keyword.
Steps :
Navigate to the touch-2.2.1 SDK folder which is located at /Application/XAMPP/htdocs/touch-2.2.1/
sencha generate app MyWeb ../MyWeb/myweb
But, it failed to create a path at this specified location.
Can someone guide me with the steps to solve this?
Use following steps:
Go to directory where you have put Sencha Touch folder.
e.g. On Linux, if you have put it in Document/sencha/sencha_touch2.2.1 go to that directory using cd Documents/sencha/sencha_touch2.2.1.
Use command to generate app :
sencha generate app appname destination directory path/your app name.
e.g. You want to create app in www directory,use
sencha generate app myapp /var/www/myapp1
here myapp is app name and myapp1 is a directory in www that contains all application structure.
Try this:
sencha -sdk /path/to/sencha-touch-2-sdk generate app MyApp /path/to/www/myapp
Here,
/path/to/sencha-touch-2-sdk is path to your Sencha Touch library folder
/path/to/www/myapp is the path to the app
Follow following steps it may be helpful
1> Download Sencha CMD
2> Install Sencha CMD for that you required java installed on machine set environmental path of java.
3> After successful installation sencha cmd set sencha cmd environmental path.
4> Now open terminal/commandprompt type sencha if everything work fine it shows sencha help and sencha installed cmd version.
5> Now download sencha touch extract sencha touch folder in any directory you want.
6> After that go to that sencha touch folder from terminla or command prompt.
7> Then type following command for generating new app.
sencha generate app app_name /path/to-set-application/app_name
8> Open Webkit browser like chrome or safari type your folder path like
localhost/app_name
It Work !
In my Sencha 2.0 App I had this in the app.json to defined where it should put the "compiled" javascript, but in Sencha 2.1 example apps its removed. It isnt respected after I updated to Sencha 2.1, anyone ones what happend to this?
/**
* Default paths to build this application to for each environment
*/
"buildPaths": {
"testing": "../../../../parentapp/build/testing",
"production": "../../../../parentapp/build/production",
"package": "../../../../parentapp/build/package",
"native": "../../../../parentapp/build/native"
},
Sencha Touch 2.1 and Sencha Cmd 3.1 no longer use app.json's buildPaths.
These are now defined (well, scattered) in a sequence of build.xml, build-impl.xml, and sencha.cfg files.
Display hidden directories/file and navigate to directory for your app. In this folder you will find a hidden folder named ".sencha". Within this folder you will find a folder "app" as well as "workspace" possibly (workspace is not a default creation). Inside the app folder is sencha.cfg where you can define the default build path for your application.
This option will place your builds in a folder "build" above your app folder:
app.build.dir=${app.dir}/../build
Using Sencha Cmd you can then type the following line, with the optional suffix defining type of build (defaults to production).
sencha app build (testing|production|package|native)
Package builds use a file called packager.json for build details.
I have installed SenchaSDKTools-2.0.0-beta3-windows on my windows Xp 32-bit.
following is the command I am running on command prompt.
C:\Program Files\SenchaSDKTools-2.0.0-beta3>sencha app create MyApp c:\xampp\htdocs\sencha\myapp\
Giving following error
[ERROR] the current workind directory (C:\Program
Files\SenchaSDKTools-2.0.0-beta3>) is not valid SDK directory. Please
'cd' in to a SDK directory before executing this command.
environment variable has been set following way.
Variable name : Path
Value : C:\Program Files\SenchaSDKTools-2.0.0-beta3
can anyone figure out what exactly wrong in this process ?
*****Sencha Touch setup Guide steps(in Window)******
Download Sencha Touch SDK Tool. (http://www.sencha.com/products/touch/download/ -->SDK Tools Beta for Developers). Run .exe file. It will install tool to default path. (i.e. C:\Program Files\SenchaSDKTools-2.0.0-beta3)
Download Sencha Touch SDK. (Download openSource version file licensed under GPL.).
Extract SDK you just download in step 2.
Open Command line terminal (start->Run->type cmd). Change directory path to SDK path as you just extracted in step3.
Verify that Sencha Command is working properly on your machine. So Type Sencha.
E.g. sdkPath>sencha
you will see "Sencha Command v2.0.2" message with other sencha command detail.
Create app in your web directory by typing following.
E.g. sdkpath> sencha app create firstSenchaApp "path/ to/ www"
(If you have tomcat 7 installed in your computer, give path to \apache-tomcat-7.0.30-windows-x86\apache-tomcat-7.0.30\webapps)
Note: There must not be space in directory path name. _(underscore),- (desk) are allowed.
If app is not generated in step 6. There might be an error. There are as follow:
If error message appear is "sencha' is not recognized as an internal or external command, operable program or batch file.”, follow these steps to troubleshoot:
The path to SDK Tools directory is prepended to your system's PATH environment variable.
From the terminal, run
echo $PATH or echo %PATH% .
The SDK Tools directory should be displayed in part of the output. If this is not the case, add it to your PATH manually.
The environment variable SENCHA_SDK_TOOLS_{version} is set, with the value being the absolute path to the installation directory mentioned above.
For example: If the installed version is '2.0.0-beta2', a SENCHA_SDK_TOOLS_2_0_0_BETA2 must be set.
From the terminal, run
echo $SENCHA_SDK_TOOLS_2_0_0_BETA2 or echo %SENCHA_SDK_TOOLS_2_0_0_BETA2% on Windows.
If the output is empty, set the environment variable manually.
Wrong Current Working Directory
A common mistake is not running Sencha Command within either a valid SDK directory or an application directory. If the current directory is not a SDK or application directory, "sencha" command will fallback to backwards-compatible mode. As of SDK Tools release "2.0.0-beta2", you should see a clear warning in such case:
"The current working directory (...) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode." So in this case follow proper step as mentioned above.
Reference:
http://www.sencha.com/forum/showthread.php?192169-Important-SDK-Tools-Sencha-Command-Update
There is an invisible file that you need to copy, called .senchasdk. Make sure it is in the folder.
I think you're having the same problem I had; I had attempted to run 'sencha app create...' from the folder containing sencha.bat. Instead, you need to run 'sencha app create...' from the sencha-touch-2.0.1.1 folder (which contains the .senchasdk file).
See this previous SO question!
Save my days.
By the way, if you can't extract the sencha-cmd to sdk tools, try to extract on other location and copy the folder [3.0.0.250] to your sdk tools > [bin] folder.
hope this helps.
I installed the ST SDK tools, and when I do 'sencha' at the command line I see this:
$ sencha
Sencha Command v2.0.0 Developer Preview
Copyright (c) 2011 Sencha Inc.
usage: sencha COMMAND [ARGS]
The available commands are:
build build a JSB project
create bootstrapdata generate boostrap data
create jsb generate a minimal JSB project for an app
create manifest generate classes manifest
package package your Touch web app into a native bundle
slice theme slice a custom theme's images for IE
See 'sencha help COMMAND' for more information on a specific command.
But when I try 'create bootstrapdata' it is asking me for all sorts of options.
$ sencha create bootstrapdata
usage: sencha create bootstrapdata [OPTIONS...]
COMMAND: Generate Bootstrap Data
DESCRIPTION:
Generate boostrap data
OPTIONS:
--core[=]value, -c[=]value (required)
The list of all core package names, comma-separated, for example:
"foundation,core,dom"
--ignore[=][value], -i[=][value]
The list of items to be ignored, comma-separated
--jsb[=]value, -j[=]value (required)
The path to the framework's jsb3 file
--output[=]value, -o[=]value (required)
The file path to write bootstrap data to
--output-release[=][value], -r[=][value]
The file path to write bootstrap data-release to
--platform[=]value, -p[=]value (required)
The path to platform source directory
--src[=]value, -s[=]value (required)
The path to the framework's source directory
How do I use one command at the command-line, without needing filepaths and other 'required' options, to generate a 'basic Hello World' ST2.x app?
Thanks.
Edit1: Btw, What I am trying to do is what Tommy Maintz did in his presentation on ST1.x at ST 2010 Conference.
Sencha generate does not exist for Sencha Touch 2 at this time. Sencha have plans to release an update for it at some point in the future, after ST2 has been released.
sencha create bootstrapdata is used when compiling your application into one JS file. You can find out more information about this here.
I also recommend you to ask questions over on the Sencha Touch Forums, which is extremely active.
If you want to do just that then go here http://sencha.com/x/6p and download the code from the presentation. In there you will find folder Command in the lib folder. While in that folder execute the following command:
./sencha generate app 'MyApp'
Note the ./