1. #1
    Sencha User
    Join Date
    Jul 2010
    Location
    Poznan
    Posts
    6
    Vote Rating
    0
    wi3dzmin is on a distinguished road

      0  

    Default Unanswered: Adding images to appcache

    Unanswered: Adding images to appcache


    Hi

    I'm trying to build my Sencha Touch 2.1 application for production environment. I want to add some images to application cache because I would like my application to work offline.

    So, I'm adding desired image file to app.json file:

    Code:
    "appCache": {        /**
             * List of items in the CACHE MANIFEST section
             */
            "cache": [
                "index.html",
                "config.json",
                "./resources/images/close-icon.png"
            ],
            /**
             * List of items in the NETWORK section
             */
            "network": [
                "*"
            ],
            /**
             * List of items in the FALLBACK section
             */
            "fallback": []
        }
    Unfortunately when I try to build my application, I get following error:

    Code:
    [INF]           Generated app.json
    [INF]           Embedded microloader into index.html
    [INF]           Generating appcache
    [INF]           Generating checksum for appCache item: index.html
    [INF]           Generating checksum for appCache item: config.json
    [INF]           Generating checksum for appCache item: ./resources/images/close-icon.png
    [ERR]           BUILD FAILED
    [ERR]           com.sencha.exceptions.BasicException: The following error occurred while executing this line:
    [ERR]           C:\Users\...\.sencha\app\build-impl.xml:120: javax.script.ScriptEx
    ception: sun.org.mozilla.javascript.internal.WrappedException: Wrapped com.sencha.exceptions.BasicException: Cannot find
     file : C:\Users\...\production\.\resources\images\close-icon.png (<Unknown
    source>#186) in <Unknown source> at line number 186
    [ERR]                   at com.sencha.exceptions.BasicException.wrap(BasicException.java:43)
    [ERR]                   at com.sencha.cli.Command.dispatch(Command.java:104)
    [ERR]                   at com.sencha.cli.Commands.dispatch(Commands.java:49)
    [ERR]                   at com.sencha.cli.AbstractCommand.dispatch(AbstractCommand.java:182)
    It happens every time I try to add some not js/json file to appCache.
    Why? How can I fix this?

    I'm using sencha cmd 3.0.0.250

    Thank!

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,207
    Answers
    3517
    Vote Rating
    856
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Currently Sencha Cmd doesn't support it via app.json but we will be adding support in a coming version.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    May 2013
    Posts
    1
    Vote Rating
    0
    AndrewDelo is on a distinguished road

      0  

    Default Can this be done yet?

    Can this be done yet?


    I am using SenchaCmd-3.1.1.274-windows.exe and cannot build with image files in the appcache - the checksum creation routine fails with most .JPG and .PNG files and some .bmp files.

    But it all worked on a previous version about one year ago!

    As offline working seems so essential for many HTML5 apps, I am puzzled as to what is happening.

    Please could anyone from Sencha let me know when this will be available.

    Many thanks.

    Andrew