Sencha Touch 2: Cannot find module `/sencha-sdk-dir/command/sencha.js` - sencha-touch-2

I am on Arch Linux x64 with Sencha Touch 2 x64 installed. From the SDK directory, I ran ./sencha
[jiewmeng#JM SenchaSDKTools-2.0.0-beta3]$ ./sencha
[WARN] The current working directory (/opt/SenchaSDKTools-2.0.0-beta3) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode.
Sencha Command v2.0.0 Beta 3
Copyright (c) 2012 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 locale generate a template locale file from source
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.
I fixed that by adding a file .senchasdk with just "." init (as I figued Google-ing), but now I get
[jiewmeng#JM SenchaSDKTools-2.0.0-beta3]$ ./sencha
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module '/opt/SenchaSDKTools-2.0.0-beta3/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)
Whats wrong?

I solve this problem just adding the SDK path as a System Variable, and the run the command inside the sencha library folder, not the SDK folder.

I was getting the same warning as:
[jiewmeng#JM SenchaSDKTools-2.0.0-beta3]$ ./sencha
[WARN] The current working directory (/opt/SenchaSDKTools-2.0.0-beta3) is not a recognized Sencha SDK or application folder. Running in backwards compatible mode.
Sencha Command v2.0.0 Beta 3
Copyright (c) 2012 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 locale generate a template locale file from source
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....
Then I downloaded the Sencha-Touch-2.0.1.1-gpl and extracted the contents to my web-root (i.e., /var/www/sencha-touch-2.0.1.1), and lastly downloaded the SenchaSDKTools and installed it via terminal as root user as follows:
root#user:/your/directory/where yo downloaded the sdk tool# ./SenchaSDKTool-2.0.1-beta3.run
I then waited for the installer to unzip the file and selected the installation directory as same where I put the Sencha-Touch library and the we have the following:
root#user:/var/www/sencha-touch-2.0.1.1# ./sencha
Sencha Command v2.0.2
Copyright (c) 2012 Sencha Inc.
.. and that is it people happy coding in sencha :-)

#todotresde Could you please share a full recipe for how to configure this on a Mac OS X.
I've just downloaded and installed the Sencha SDK in the /Applications folder, but I would hate to populate that folder with Sencha applications as instructed in the SenchaDocs at
http://docs.sencha.com/touch/2-0/#!/guide/command
cd /path/to/sencha-touch-2-sdk
sencha
The SDK install adds the SDK path variable to ~/.bash_profile
export PATH=/Applications/SenchaSDKTools-2.0.0-beta3:$PATH
export SENCHA_SDK_TOOLS_2_0_0_BETA3="/Applications/SenchaSDKTools-2.0.0-beta3"
I see some good pointers here:
http://www.sencha.com/learn/a-sencha-touch-mvc-application-with-phonegap/
As per a standard Sencha application architecture, download the SDK and then place (or symlink) it within the lib directory, named touch. We will be putting our own code in the app directory
IMPORTANT: When you are developing or experimenting, it's fine to simply place the whole SDK inside the lib folder like this. But when deploying, make sure that only the required JavaScript and CSS files remain in that folder, and remove the rest of the SDK. You do not want to compile and distribute the entire Sencha Touch SDK with your app.

First you add the SenchaSDK folder to you path,
export PATH=$PATH:/your/path/to/SenchaSDK
then you set the SENCHA_SDK_TOOLS_2_0_0_BETA3 environment variable,
export SENCHA_SDK_TOOLS_2_0_0_BETA3=/your/path/to/SenchaSDK
Now you go to your sencha library directory, like /your/path/to/sencha-touch-2.0.1.1, and you should be able to run the sencha command with no problem.

Related

Missing fonts when building/running Appcelerator app from XCode

I've recently updated from Titanium w/3.5.0.GA SDK to Appcelerator Studio w/5.2.0SDK and can no longer build and run the appc (5.1.0 CLI) generated projects in XCode (7.2.1) without losing the ability to display my custom font resources (app/assets/fonts).
When building a project for iOS in studio (latest 4.4.0) and deploying to connected iPhone 6 (running 9.2) all fonts appear correctly in app. However when building and running the <projectname>.xcodeproject that is generated by appc during this process the same fonts do not show?
Is this related to https://jira.appcelerator.org/browse/TIMOB-19818 ? Is there any fix on the horizon if so?
I have always relied on modifying the generated projects to include other asset catalogs and manually alter the build and version numbers prior to appstore submission so am very curious to find a solution to this issue - all help much appreciated!
FYI - for reference, I've tried to build the same project generated in Titanium studio w/3.5.0.GA within the Latest XCode (7.2.1) as above and the fonts still work correctly so this issue seems to be with Appcelerator Studio with CLI 5.1.0 and SDK 5.2.0 combination.
You can follow this below two steps. This is a workaround, might work for you.
Step 1: Grab resource files from debug ipa:
a. Build a debug version for your iPhone device.
b. After the app has successfully launched on your iPhone, navigate to the ipa file in the debug build folder. Click right on the file (or cmd-click) and choose to uncompress the file
c. In the extracted archive find the payload file. Also right click on the file (or cmd-click) and choose to show its contents.
d. You should now see your resource files and folders. Select all the required files and folders and copy them in some new folder.
Step 2: Add files to XCode project
a. Open the build XCode project with XCode
b. In the left column right click (or cmd-click) on your project
c. Choose "Add Files to [project name]"
d. In the file dialog multiselect your files and folders you copied from the debug ipa in step 1
e. That's it. Now archive your product and submit it.

Dropping a new hybrid app into an existing worklight project and it can't find the dojo files

We're trying to unzip a new worklight hybrid app (built by a separate team) into an existing worklight project, but it can't find the dojo files for packaging, any ideas? We have only included the app subdirectory in this zip file.
We're not using the dojo toolkit, we're using a locally packaged dojo subdirectory
For some reason the new application isn't picking up the dojo path we've specified in build-dojo.properties. Here's our build-dojo.properties information:
app.id=ACMWorkExecution
dojo.workspaceRoot=/AnywhereWorkManager/www
Any ideas of places we could debug? We put some echo statements in the build-dojo.xml file to echo out the dojo.workspaceRoot but it didn't even appear to be called.
We're building the app using the app-builder ant task of worklight.
We found out we had an invalid build-dojo.xml file that was causing this issue. Replacing the build-dojo.xml file with a fresh one fixed it.

dojo/_base/*js missing from worklight apk in wl 6.1

I have a hybrid app that was created with WL 6.1 that uses the included dojolib. Currently it is in production for iphone and we are adding the android flavor of it. When running the code from the mobile simulator on the console, both the android and iphone work fine. The ipa file works fine. When I run the hybrid on an android device (Samsung S4), the application throws errors in the log on app startup. I have the "provide dojo libraries" turned off. In the DDMS log I see statements like the following:
09-09 12:47:12.092: E/AndroidProtocolHandler(20324): Unable to open asset URL: file:///android_asset/www/default/dojo/_base/declare.js
09-09 12:47:12.263: E/AndroidProtocolHandler(20324): Unable to open asset URL: file:///android_asset/www/default/dojo/_base/connect.js
09-09 12:47:12.303: E/AndroidProtocolHandler(20324): Unable to open asset URL: file:///android_asset/www/default/dojo/_base/event.js
Looking out in the android project in eclipse, I see those files in the "assets/www/default/dojo/_base" directory. The issue is when I look in the APK file, the "_base" directory is not there. Any help as to understanding why it is missing?
Your application should be using the compiled version of the dojo files, it seem that its not.
i would check
These files : core-web-layer.js and mobile-ui-layer are in your www folder
That the wlCommonInit function includes below:
function wlCommonInit() {
require([ "layers/core-web-layer", "layers/mobile-ui-layer" ], dojoInit);
}
I've also found an alternative way to get around the android packaging bug. As I mentioned earlier one way is to use the DojoBuildFactory to create a new layer that would have the files imbedded in them. This is the same process that WL uses to create the core-web-layer and mobile-ui-layer. I have a team working on this, but the documentation is ... scant and it is a time consuming process.
While they were doing that, I found what I think is a cleaner way of addressing the issue. Effectively open up an unsigned apk, insert the files, and then sign the APK. Worked like a charm. Here are the steps I used:
Build from working pointing to the correct worklight server and with the provide missing dojo libraries turned off
Export as Android project as an unsigned apk
Open command prompt with right env settings pointing to JDK and ADT
Create keystore (if not already done)
Unpack into temp using jar
Copy dojo files over from android/native/www/default
Pack back into apk using jar
Sign the jar
Zipalign the jar
Now you have a working apk that includes the files/directories in asset that begin with a "_".

Apache Cordova (3.4.0) CLI install on Windows

I am trying to install cordova, I do excatly what is said in the CLI tutorial here.
After creating a new App
cordova create hello com.example.hello HelloWorld
I list all platforms and see following:
Where is other platforms liks ios? Moreover, when I try
cordova platform add android
I get following error:
What I am doing wrong or what is wrong with the Cordova?
To work, this cordova command needs to use some programs located into your sdk/tools directory. You need also have installed apache ant.
Then you must add these directories into your PATH system variable:
Background:
let's assume you have installed your Android SDK to the c:\sdk\android directory
you have installed you Apache ant to the c:\tools\apache-ant directory
Then you must create two system variables:
ANDROID_HOME with the c:\sdk\android value
ANT_HOME with the c:\tools\apache-ant value
Finally, you must modify the PATH variable and add those two to the end of the PATH' value:
;%PATH%\tools;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
NOTE: for those who uses Linux, the instruction differs a bit.
More documentation available here.

Linking to library

I installed ImageMagick through MacPorts. So all library files are in /opt/local/lib and headers in /opt/local/include/ImageMagick. It works OK on my mac. In xCode Build Settings - > Search Paths everything looks to be set OK.
Added library files to Linked Frameworks and Libraries
When I build my app it looks to be working. But when I try to run builded app on other computer where ImageMagick is not installed there comes this error message:
How can I fix it to make users to be able use my app without needing to additionally install ImageMagick and so on? How to link it that needed library files would come with my app (in project bundle)?
Af of now your linking library is referred from /opt/local/lib/ ---
Solution for your issue:
Make sure where ever app is installed suport library is installed to right location
Carry the dynamic library with app bundle and refere the dyld from the app bundle which will be relative to app bundle launch path.
Update: If you are looking for the second option --- With this option your library will be placed inside your app bundle ... so app can refer the library from the app bundle.
The precompiled dynamic library can be carried with the application -- in xCode --> Go to Build Phases for the target --> Build Phase (copy files) ... this will make sure your dynamic library is copied to into your app bundle ...
Update “install name” inside each dynamic library --- You can use 'otool' command to know present install path of your precompiled library and you can precompiled library install path using'install_name_tool' command in your terminal.
No support for it from ImageMagick forum, no support from StackOverflow, so I guess its impossible...