Looks like we cannot reproduce this. Please provide another test case to reproduce this issue.
  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Vote Rating
    1
    cchilds is on a distinguished road

      0  

    Default window.openDatabase() breaks build

    window.openDatabase() breaks build


    REQUIRED INFORMATION


    ST version tested:
    • ST 2.0.1.1
    Description:
    • While developing my latest app, I added some database code and could no longer do a production build of the app. It simply hangs while "Resolving your application dependencies". I boiled the problem down a single line in my code and tested it with a clean project. The following method call seems to be the culprit thats causing some sort of cyclic dependency that breaks the build:
      Code:
      window.openDatabase("database", "1.0", "database", 5000000);
    Steps to reproduce the problem:
    • Navigate to your ST SDK folder and run sencha app create
    • Open the app.js of your new project and on the last line of the launch() function add the above openDatabase line
    • Run sencha app build production and notice it will not build
    The result that was expected:
    • My app should build.
    The result that occurs instead:
    • It hangs while resolving dependencies.
    Operating System:
    • Windows 7

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,047
    Vote Rating
    850
    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


    This seems to be working for me. This is my app.js to confirm I did it in the right spot

    Code:
    Ext.application({
        name: 'MyApp',
    
        requires: [
            'Ext.MessageBox'
        ],
    
        views: ['Main'],
    
        icon: {
            '57': 'resources/icons/Icon.png',
            '72': 'resources/icons/Icon~ipad.png',
            '114': 'resources/icons/Icon@2x.png',
            '144': 'resources/icons/Icon~ipad@2x.png'
        },
    
        isIconPrecomposed: true,
    
        startupImage: {
            '320x460': 'resources/startup/320x460.jpg',
            '640x920': 'resources/startup/640x920.png',
            '768x1004': 'resources/startup/768x1004.png',
            '748x1024': 'resources/startup/748x1024.png',
            '1536x2008': 'resources/startup/1536x2008.png',
            '1496x2048': 'resources/startup/1496x2048.png'
        },
    
        launch: function() {
            // Destroy the #appLoadingIndicator element
            Ext.fly('appLoadingIndicator').destroy();
    
            // Initialize the main view
            Ext.Viewport.add(Ext.create('MyApp.view.Main'));
    
            window.openDatabase("database", "1.0", "database", 5000000);
        },
    
        onUpdated: function() {
            Ext.Msg.confirm(
                "Application Update",
                "This application has just successfully been updated to the latest version. Reload now?",
                function(buttonId) {
                    if (buttonId === 'yes') {
                        window.location.reload();
                    }
                }
            );
        }
    });
    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
    Mar 2012
    Posts
    18
    Vote Rating
    1
    cchilds is on a distinguished road

      0  

    Default


    hmm... Any ideas why it wouldn't be working for me then? If I remove that line, it works just fine.

  4. #4
    Sencha - Sencha Touch Dev Team
    Join Date
    Oct 2010
    Posts
    86
    Vote Rating
    21
    RossGerbasi will become famous soon enough RossGerbasi will become famous soon enough

      0  

    Default


    I am seeing this exact problem myself.

    If I comment out my openDatabase line it builds further, with it in my code it hangs at Resolving your application dependencies... Not sure what to do...

  5. #5
    Sencha - Sencha Touch Dev Team
    Join Date
    Oct 2010
    Posts
    86
    Vote Rating
    21
    RossGerbasi will become famous soon enough RossGerbasi will become famous soon enough

      0  

    Default


    I ended up figuring this out, I hope it helps. Essentially it was a corrupt database inside of PhantomJS.

    to fix this just trash your databases store by phantom. They are located

    C:\Users\{USERNAME}\AppData\Local\Ofi Labs\PhantomJS
    or
    /Users/YOUR_USER/Library/Application Support/Ofi Labs/PhantomJS

    hope that helps, certainly was causing me a lot of problems.

  6. #6
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Vote Rating
    1
    cchilds is on a distinguished road

      0  

    Default


    I ended up resolving it by moving the location of this call to a later view (I originally had it in the controller for my first view, changed it to my second view which was really when I needed the database created anyway and it worked). Don't know why this resolved the issue, but it did.

  7. #7
    Sencha - Sencha Touch Dev Team
    Join Date
    Oct 2010
    Posts
    86
    Vote Rating
    21
    RossGerbasi will become famous soon enough RossGerbasi will become famous soon enough

      0  

    Default


    Well crap, I actually thought the phantomJS database was the problem but it seems it wasn't. Well it was A problem but not the only problem.

    Apparently you are correct that if the database is opened at "some point" it causes a hang in the build. I do not have the option to move my database calls later as i need them first thing when the application opens.

    Does anyone know if there is a way to detect PhantomJS with javascript so i can work around this bug? Essentially I need something like if (running in Sencha SDK tools build) { skip database stuff}

    I know its hacky, but i do need the application to build

    thanks.

  8. #8
    Sencha User
    Join Date
    Mar 2012
    Posts
    18
    Vote Rating
    1
    cchilds is on a distinguished road

      0  

    Default


    If you absolutely have to, one thing I did before I fixed mine was build without the openDatabase call then manually insert it afterwords into the build's app.js on the line you need it. It's a pain to do, but it works...