Success! Looks like we've fixed this one. According to our records the fix was applied for TOUCH-2243 in a recent build.
  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    thinkerx is on a distinguished road

      0  

    Exclamation 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:

    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"
        ]
    }
    As you guys can see my working directory is C:\Dev where I have the directory structure as follows:
    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

    HTML 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>
    app.js

    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();
                                }
                            }
                        ]
                }
                ]
        });
            
        }
    });
    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.
    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:
    Code:
    sencha package configTemplate.json
    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.

    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.

  2. #2
    Sencha User
    Join Date
    Feb 2012
    Posts
    3
    Vote Rating
    0
    room9 is on a distinguished road

      0  

    Default


    I also get no messages when targeting AndroidEmulator on a Mac. Just fails with no messages.

  3. #3
    Sencha User
    Join Date
    Feb 2012
    Posts
    5
    Vote Rating
    0
    Stim is on a distinguished road

      0  

    Default


    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 variable
    Last edited by Stim; 23 Feb 2012 at 11:35 PM. Reason: Added Information

  4. #4
    Touch Premium Member svenna's Avatar
    Join Date
    Jun 2007
    Location
    Oslo,Norway
    Posts
    563
    Vote Rating
    26
    svenna has a spectacular aura about svenna has a spectacular aura about

      0  

    Default


    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-Tools
    Sven Tore Iversen

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    thinkerx is on a distinguished road

      0  

    Exclamation


    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

  6. #6
    Sencha User Jamie Avins's Avatar
    Join Date
    Mar 2007
    Location
    Redwood City, California
    Posts
    3,661
    Vote Rating
    18
    Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough Jamie Avins is a jewel in the rough

      0  

    Default


    Thank you for the report. We'll get back to you shortly on these issues.

    Sencha Inc

    Jamie Avins

    @jamieavins

  7. #7
    Sencha - Sencha Touch Dev Team voloshyn's Avatar
    Join Date
    Jan 2012
    Posts
    118
    Vote Rating
    1
    voloshyn is on a distinguished road

      0  

    Default


    '\' symbol is not valid in JSON format, replace it to '/', so you have something like this:

    C:/Users/Antonio/

  8. #8
    Sencha User
    Join Date
    Dec 2010
    Posts
    5
    Vote Rating
    0
    thinkerx is on a distinguished road

      0  

    Exclamation


    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.

  9. #9
    Ext JS Premium Member
    Join Date
    Sep 2009
    Posts
    85
    Vote Rating
    0
    HyGy is on a distinguished road

      0  

    Default


    I get the same on Ubuntu 11.04 with SenchaSDKTools-1.2.3.

    Quote Originally Posted by Jamie Avins View Post
    Thank you for the report. We'll get back to you shortly on these issues.

  10. #10
    Sencha - Sencha Touch Dev Team voloshyn's Avatar
    Join Date
    Jan 2012
    Posts
    118
    Vote Rating
    1
    voloshyn is on a distinguished road

      0  

    Default


    @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