Sencha App Upgrade Issue: Must be run from App folder - sencha-touch

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.

Related

The SDK directory 'C:\Users\ABC\AppData\Local\Android\Sdk\platform-tools;C:\Users\ABC\AppData\Local\Android\Sdk' does not exist

Could somebody help me fix this problem?
When I run react-native run-android in CMD Windows OS, I got this error.
A problem occurred configuring project ':app'.
The SDK directory 'C:\Users\ABC\AppData\Local\Android\Sdk\platform-tools;C:\Users\ABC\AppData\Local\Android\Sdk' does not exist.
I searched everything to fix it but not successful.
I created local.properties in android dir and add this: sdk.dir = C:\\Users\\ABC\\AppData\\Local\\Android\\Sdk
Create ANDROID_HOME variable: C:\Users\ABC\AppData\Local\Android\Sdk and add to path: ...%ANDROID_HOME%platforms;%ANDROID_HOME%platform-tools
but no luck.
Please help.
You can also set android path from CMD.
set ANDROID_HOME=C:\Users\yourusername\AppData\Local\Android\sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Note: You have to run these two commands every time you open new instance of your CMD
If you have the same error even after configuring the environment variables like the above answer, Check the local.properties file. Most probably there can be different ANDROID_HOME path.
local.properties file located in the android folder of the react native code base.
After installing of Android studio you need run it first and create your device. (i don't remember how but it helped for me)Untill this done you not have android folder. To watch my suggestion open C:\Users\yourusername\AppData\Local
and go to your Local folder
mark 'View/show-hide/hidden items' in as on the pictures.
Then open android studio, and create android device.And you will see how hidden android folder have appeared(can be seen if hidden items marked)

Create a Sencha Touch app using the command line tools - Beginner

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 !

Generate a sencha touch app

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.

How to launch console app from terminal with parameters?

I've got console app in Xcode which uses Core Data and should get one parameter from console. Problem is it builds without packaging into .app file. So I can't even launch it from terminal, not even pass it a parameter. Maybe I missed some project settings, allowing me to do this?
you should run the actual program within the app e.g. ./MyProgram.app/Contents/MacOS/MyProgram if you are in the directory that contains the .app.
open -a "./MyProgram.app/Contents/MacOS/MyProgram" --args myarg

SenchaSDKTools-2.0.0-beta3-windows Command not working

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.