[r154] Windows 8 Export breaks Index.html - jQuery

0 favourites
  • 10 posts
  • [Updated 12/16/2013] Updated with screenshots of different files in the new exported version. At bottom of this post.

    In the latest build when you create a windows 8 app or any app and export as a windows 8 app, the index.html file does not have everything it should. I can compare it with my older windows 8 export that works fine, but with exporting using the latest build I consistently get the javascript error. I can confirm it is an issue with the way the page is formed by copying the contents of my old index.html file in place of the new one and the new app will start working. There are a bunch of little differences between the structure of the new index.html files and the old ones that C2 would generate.

    I am in the process of rebuilding my windows 8 application and cannot use the export functionality for a new build due to this issue. Here are Links to the old and new index.html as well that will help you find the issue.

    Old Index.html file(working): dl.dropboxusercontent.com/u/138635871/C2BugCapx/indexOLDWorking.html

    New Index.html file(broken): dl.dropboxusercontent.com/u/138635871/C2BugCapx/indexNEWBroken.html

    Link to .capx file (required!):

    dl.dropboxusercontent.com/u/138635871/C2BugCapx/win8adtest.capx

    Steps to reproduce:

    1. Open the capx

    2. Export to windows 8

    3. Open in visual studio

    4. add the test certificate

    5. Run the app (F5)

    Observed result:

    App Fails to run and displays a javascript error that jQuery is undefined.

    Here is the Error Text:

    Unhandled exception at line 77, column 3 in ms-appx://1195e6d7-3fa5-4ca5-ba49-a39875d7e345/index.html

    0x800a1391 - JavaScript runtime error: 'jQuery' is undefined

    Here is the code from line 77:

    jQuery(window).resize(function () {

                  ?cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());

              });

    Expected result:

    App should run and display in windows 8

    Browsers affected:

    Chrome: N/A

    Firefox: N/A

    Internet Explorer: N/A

    Operating system & service pack:

    Windows 8.1 (All current updates)

    Construct 2 version:

    r154

        

    Just wanted to update this, I am seeing differences in the files that are generated in the solution as well. Some also seem to be missing according to visual studio... Did something get changed or mixed up between the windows 8.1 and windows 8.0 options? I export as windows 8.0 and here is the difference between my old and new exports (old is r152, new is r154)

    New is on the left, old (working) is on the right...

    <img src="http://dl.dropboxusercontent.com/u/138635871/IssueScreenShots/Win8SolutionFilesDifferent.png" border="0" />

    I figure you guys are probably off for the weekend, so I am just trying to add as much detail as I can to get the windows 8 export piece fixed as it is currently broken and I cannot run the generated solutions from Visual Studio any more...

  • Just wanted to check in on this... is this a new structure that just isn't documented yet? Are there new steps involved for exporting to windows 8?

  • Closing as can't reproduce, I exported your .capx for both Windows 8.0 and 8.1 and it worked fine. The index.html has a script tag to load jQuery just before the script tag which handles resizes using jQuery, which means jQuery is always loaded before it's used, and I verified the app starts and runs OK. Your links to Dropbox files do not work because you cannot upload Windows 8 exports, they must be run from within Visual Studio only - you should use the HTML5 export if you want to run them off the web.

  • Thanks Ashley that's really odd... I wasn't wanting to run them off the web, they were links to the index files so that you could see the differences in them code wise. Not to run the game from there.

  • It looks like you manually edited it and broke it. The HTML file references jQuery 1.7.1, which Construct 2 hasn't exported for a long time now.

  • Ashley That is odd... maybe due to adding Podes Div or the Metro plugin and then removing them... Thanks for the info!

  • Ashley any idea on those extra files that Visual studio is marking in the solution explorer? For some reason it keeps adding those references when I export:

    In-App-Purchase-TestingOnly.xml

    Settings-About.html

    Settings-GamePreferences.html

    Settings-Help.html

    Settings-Purchase.html

    viewstates.css

    I don't see these in my old Windows 8 Export (r152). This is a Windows 8.0 (VS2012) export...

  • Those files definitely don't come from Construct 2. They are probably dependencies of a third party plugin.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ashley Thanks!

  • Ashley looks like that Metro plugin totally hosed the export index.html for Windows 8 applications. Reinstalling and hoping that it will clean itself up. I deleted the plugin directory for it. Are there any other steps for safely cleaning up plugins or returning Construct back to default project templates if a plugin altered them?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)