sencha generate app failing from INSIDE SDK FOLDER - sencha-touch

I issued this command:
sencha generate app LaBucaDiSanMatteo c:\xampp\htdocs\LaBucaDiSanMatteo
from inside SDK folder (c:\touch-2.3.1).
I got:
[INF] Workspace does not have framework null at C:\xampp\htdocs\LaBucaDiSanMatteo ... copying
[ERR] Failed to determine framework name. Please ensure this command was issued from either a framework or application directory
I'm using Sencha Cmd v4.0.2.67

Solved by myself.
Sencha CMD works only with the GPL version. Not working with the free commercial version.
I downloaded the first by mistake. I discovered the problem comparing the 2.3 with the old 2.2.1 (luckily I kept a copy).

Related

How can I enable Flutter/Dart language experiments?

I want to use the new spread syntax in Dart.
I'm using Android Studio for Flutter development and I receive this error.
This requires the --spread-collections experiment to be enabled
ListView(children: [...listTiles, MyWidget()])
However, I didn't find anywhere where I could specify this option.
I couldn't even make it work on the command line. flutter --spread-collections run gives Could not find an option named "spread-collections"..
flutter --version
Flutter 1.3.8 • channel beta • https://github.com/flutter/flutter.git
Framework • revision e5b1ed7a7f (4 weeks ago) • 2019-03-06 14:23:37 -0800
Engine • revision f4951df193
Tools • Dart 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
You need to create an analysis_options.yaml file in the root of your flutter app and write something like
analyzer:
enable-experiment:
- spread-collections
Also make sure to switch to the correct channel where the new feature is included eg (dev, beta or master)
flutter channel dev
And also make sure you have a recent enough version of flutter
flutter upgrade
Ensure you are on the right version of flutter and dart that allows that feature by running
flutter --version
you may also have to manually change your pubspec.yaml file to specify the correct dart sdk (if so rerun flutter upgrade)
environment:
sdk: ">=2.10.0-0 <3.0.0"
In my case, I have followed these two steps and It worked for me.
run "flutter upgrade"
changing the sdk in the environment in pubspec.yaml
environment:
sdk: ">=2.6.0 <3.0.0"
With the new version of flutter it became an error - but it can easily be fixed by updating the sdk version:
environment:
sdk: ">=2.7.0 <3.0.0"
Just don't forget to restart VisualStudio Code or whatever IDE you're using.
You are running an old version of flutter
Spreading is available starting at flutter 1.5 and dart 2.3
Run:
flutter upgrade
Here's some fix you can try out :
1) Keep the analysis_options.yaml in your root folder with this code:
analyzer:
enable-experiment:
- control-flow-collections
2) Don't use brackets {} in between your for loops
Ex:
<Widget>[
for (final category in categories)
CategoryWidget(category: category)
],
3) Important step which is probably why it's not working for you:
Change your Dart version constraint in the pubspec.yml file in your root folder to 2.5.2 or above.
environment:
sdk: ">=2.5.2 <3.0.0"
The current answer that is working in the latest Flutter 1.17.1 or Dart 2.8.2
Create a analysis_options.yaml in the directory of the pubspec.yaml file
Write this code inside the file:
include: package:pedantic/analysis_options.1.8.0.yaml
linter:
rules:
- prefer_spread_collections
For more information head to this documentation
Something completely different yet the same. Our code was built in Flutter v1.12.13hotfix9. when we did a new installation with flutter 1.17.1 the build broke with a similar error. It seems that the new release of Flutter is not backwards compatible on certain parts.
We fixed the problem by installing the older version.
Run this command from your project's root directory:
dart --enable-experiment=spread-collections lib
After updating the environment in pubspec.yml don't forget restart your IDE
environment:
sdk: ">=2.7.2 <3.0.0"

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 "_".

This app was last modified by a newer version of Sencha Cmd - version mismatch

I'm trying to add the sencha cmd production package into my build process. But the final step when I need to package the app fails with the above error.
What I don't understand is this is a newly built application fresh from the SVN repo. The sencha cmd is the latest as I've just upgraded. So my question is when it states that the app was last modified by a newer version of sencha cmd is it lying to me?
2 things which aren't correct:
The app can't have been modified by a newer version because I've
just upgraded the build machine version of sencha cmd to the newest
version.
The app has been created by Sencha cmd in the past, but
this would have been older than the current one on the build
machine.
So I'm left baffled how to resolve this. How does Sencha Cmd 'know' that the app was last modified by a different version anyway? Is there some file within my \app folder which can be fudged so that it thinks the version is the latest? And what has the Sencha Cmd got to do with my application code-base anyway?
You can run the new Cmd version in update mode. I think this is really intended to update the Sencha Touch version, but if you just point it at the current version (2.1) then it will just update itself.
So, for example, run the line below with the latest Cmd:
sencha app upgrade [directory where 2.1 is]
Make sure you take a copy of your app.js first though, as the new version mangles this - just put your old one back after update. Also be aware that it will update your "Touch" directory, so make sure this is backed up as well.
Once the update has been run and you've put the app.js file back, your project should now build with the latest cmd.
If you have created/build your app using Sencha Cmd you will have related information (workspace.cmd.version, app.cmd.version) in following files:
PROJECT_ROOT/touch/cmd/sencha.cfg // This is SDK requirements
PROJECT_ROOT/.sencha/workspace/sencha.cfg // This is workspace build config
PROJECT_ROOT/.sencha/app/sencha.cfg // This is app build config
You can try fudging Cmd version in these files and let us know if it works :)
After doing sencha app upgrade --noframework, make sure to also run "sencha app refresh" to update .sencha metadata.
This misleading error message refers to a version change of Sencha's Cmd tool on the machine you are using. You can upgrade the Cmd scaffolding with the following command:
sencha app upgrade --noframework
From: 'sencha help app upgrade'
Options
* --noframework, -no - Upgrade only the Sencha Cmd scaffolding and not the SDK
Definitely back up your app before upgrading. The upgrade command will warn you about conflicts that need to be resolved (such as custom changes to app.js). When you open those files the differences will be noted in a standard diff format:
<<<<<<< Generated
/*
This file is generated and updated by Sencha Cmd. You can edit this file as
needed for your application, but these edits will have to be merged by
Sencha Cmd when it performs code generation tasks such as generating new
models, controllers or views and when running "sencha app upgrade".
Ideally changes to this file would be limited and most work would be done
in other places (such as Controllers). If Sencha Cmd cannot merge your
changes and its generated code, it will produce a "merge conflict" that you
will need to resolve manually.
*/
...
>>>>>>> Custom
...
Resolve the conflicts (remove the >>>>>> X lines and make sure the right lines are included in your file) and you should be all set. The most likely file to have a conflict is app.js - it'd be a good idea to compare your backed up version of that file with your modified version to be confident of the changes.
This seems to mean that all developers working on the application need to run the same Cmd version, so keep that in mind as well.

Cordova 2.1.0 not getting included in the project after install

I am creating an IOS app with cordova 2.1.0.
I installed cordova 2.1.0, by following the steps mentioned in http://docs.phonegap.com/en/2.1.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iO
Now i made changes to files like AppDelegate.m, AppDelegate.h, etc. and www folder. When i see the physical folder structure in the project, the CordovaLib.xcodeproj does'nt get included in the project. Why is this happening? Why is it not getting included in the project. Every user will not download cordova and follow the steps.
Any help will be appreciated.
Thanks.
What do you mean by "user will not download". The developer (you) have to downlod it nd create the app. Cordova is packaged within your *.ip file.
If the cordov project is not oincluded, you will be unabvle to build. If you cn build it, it is included.
If you don't want to handle the complete xcode project stuff, use build.phonegap.com

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

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.