-
23 Feb 2012 2:30 PM #1
Packaging an application for Android using Sencha Touch Native Packaging on Windows 7
Packaging an application for Android using Sencha Touch Native Packaging on Windows 7
Hi everyone,
It is the first time that I post in a forum so I'm sorry if I don't write the source code or something as it should.
I just downloaded the SDK Tools For Windows and used a simple code to try to package a sencha touch application into a native code in this case Android. But I can not figure out what it is going on with the SDK Tools since I'm not able to get that to work. I have a file name: configTemplate.json which contains the following code:
As you guys can see my working directory is C:\Dev where I have the directory structure as follows:Code:{ "applicationName":"MyApp", "applicationId":"com.apps", "versionString":"1.0", "iconName:":"icon.png", "inputPath":"C:\Dev\app", "outputPath":"C:\Dev\build", "configuration":"Debug", "platform":"AndroidEmulator", "deviceType":"Universal", "certificatePath":"C:\Users\Antonio\.android\debug.keystore", "certificateAlias":"androiddebugkey", "sdkPath":"C:\Program Files (x86)\Android\android-sdk", "orientations": [ "portrait", "landscapeLeft", "landscapeRight", "portraitUpsideDown" ] }
C:\Dev
C:\Dev\sencha-touch
C:\Dev\app
C:\Dev\build
C:\Dev\app\controller
C:\Dev\app\model
C:\Dev\app\profile
C:\Dev\app\store
C:\Dev\app\view
All those directories are empty except "C:\Dev\sencha-touch" which contains all the needed js sencha framework files and "C:\Dev\app" which is where I have two files: index.html and app.js. I'm including the source code of those files.
index.html
app.jsHTML Code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title></title> <!-- Sencha Touch JS --> <script type="text/javascript" src="../sencha-touch/resources/js/sencha-touch-debug.js"></script> <!-- My App --> <script type="text/javascript" src="app.js"></script> </head> <body> </body> </html>
I tried the app in the google chrome web browser and it works. Then I decided to try it into an Android emulator to be sure that it works too but I can not get that.Code:Ext.application({ name: 'MyApp', launch: function() { Ext.create("Ext.tab.Panel", { fullscreen: true, tabBarPosition: 'bottom', items: [ { title: 'Home', iconCls: 'home', cls: 'home', html: [ '<img width="65%" src="http://staging.sencha.com/img/sencha.png" />', '<h1>Welcome to Sencha Touch</h1>', "<p>You're creating the Getting Started app. This demonstrates how ", "to use tabs, lists and forms to create a simple app</p>", '<h2>Sencha Touch 2</h2>' ].join("") }, { xtype: 'nestedlist', title: 'Blog', iconCls: 'star', displayField: 'title', store: { type: 'tree', fields: [ 'title', 'link', 'author', 'contentSnippet', 'content', { name: 'leaf', defaultValue: true } ], root: { leaf: false }, proxy: { type: 'jsonp', url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog', reader: { type: 'json', rootProperty: 'responseData.feed.entries' } } }, detailCard: { xtype: 'panel', scrollable: true, styleHtmlContent: true }, listeners: { itemtap: function(nestedList, list, index, element, post) { this.getDetailCard().setHtml(post.get('content')); } } }, //this is the new item { title: 'Contact', iconCls: 'user', xtype: 'formpanel', url: 'contact.php', layout: 'vbox', items: [ { xtype: 'fieldset', title: 'Contact Us', instructions: '(email address is optional)', items: [ { xtype: 'textfield', label: 'Name' }, { xtype: 'emailfield', label: 'Email' }, { xtype: 'textareafield', label: 'Message' } ] }, { xtype: 'button', text: 'Send', ui: 'confirm', handler: function() { this.up('formpanel').submit(); } } ] } ] }); } });
My OS is Windows 7 x64, I have installed the android SDKs from API 8 to API 15 and also the Android SDK Tools - Revision 16.
So when I go to the command prompt and I type:
It does nothing. I can only see a few blank lines displayed on the terminal (the blank lines are variable). No error messages, no warning messages, no information messages, etc. I noticed that command is only checking whether the file name I specify exists or not. It seems it is not processing the file content since I remove all the content of my .json file and I get the same result.Code:sencha package configTemplate.json
I don't think my problem is with the Android environment since I have been working with it (the AVD emulators, etc) with other mobile frameworks and everything works fine.
I don't really know what the problem is. I wonder if the x64 Windows versions are supported for the sencha SDK Tools. What do you guys think that the problem is?
Any help will be appreciated!
Thanks in advance.
-
23 Feb 2012 4:19 PM #2
I also get no messages when targeting AndroidEmulator on a Mac. Just fails with no messages.
-
23 Feb 2012 11:33 PM #3
I am having the exact same issues
The only change I notice is when I change "Platform" in the config file from "AndroidEmulator" to just "Android" I will get an output of
"Required field is missing from config fileFailed to package application"
edit: I followed Edmund Leungs advice of making sure to have only java JDK 1.7 installed, with the bin folder added to the path variableLast edited by Stim; 23 Feb 2012 at 11:35 PM. Reason: Added Information
-
24 Feb 2012 12:36 AM #4
Me to..
My post about the problem in the SDK forum.
There are several post about noe features working in the public beta on windows 7.
So I guess Sencha was unlucky with the current build
http://www.sencha.com/forum/showthre...-first-attempt
http://www.sencha.com/forum/forumdis...ncha-SDK-ToolsSven Tore Iversen
-
24 Feb 2012 8:46 AM #5
Now I just tried on Windows XP and the same problem. The only change is that now I'm getting the message:
Code:Required field is missing from config file Failed to package application
-
24 Feb 2012 9:43 AM #6Sencha - Sencha Touch Dev Team
- Join Date
- Mar 2007
- Location
- Redwood City, California
- Posts
- 3,652
- Vote Rating
- 14
Thank you for the report. We'll get back to you shortly on these issues.
-
24 Feb 2012 3:30 PM #7
'\' symbol is not valid in JSON format, replace it to '/', so you have something like this:
C:/Users/Antonio/
-
27 Feb 2012 7:40 AM #8
When I change the "\" symbol for "/" I get:
-On Windows 7 x64 the same result (no error/info/warning messages)
-On Windows XP the "Required field is missing from config file Failed to package application" message is no longer displayed but I'm getting the same result as if I were running on Windows 7 x64. I mean I'm getting only a few blank lines on the terminal and the .apk file is not being created.
-
29 Feb 2012 2:02 AM #9
-
1 Mar 2012 4:31 PM #10
@HyGy: Linux is not supported yet
I found where the problem is, please try this version if it works: http://dl.dropbox.com/u/8793605/stbuild.msi
Success! Looks like we've fixed this one. According to our records the fix was applied for
TOUCH-2243
in
2.0.


Reply With Quote