Exported project with html/css/js script does not run correctly on export.

0 favourites
  • 3 posts
From the Asset Store
Full game Construct 2 and Construct 3 to post on Google Play
  • Hi. My project has a lot of html. Everything works fine in preview and in remote preview but when I export an apk the html doesn't display. It looks like maybe either/or/and:

    • my javascript file (in the scripts folder) isnt running/loading
    • my css file (in files folder) isn't being read/loaded
    • my html file in my files folder isn't being read/loaded

    One or all of those things Im guessing.

    Do I need to force the import/load somehow?

    Shouldn't it run exactly the same as the preview?

    Or maybe there are some other ideas?

    Cheers

    Tagged:

  • From what I can tell through some debugging is that one of my scripts (list.js) never gets loaded (in the built apk version only).

    I've tried adding a Main Script (set as main script) with just the single line:

    import "./list.js";

    ..but still content in the list.js script doesn't seem to run.

    I get the error in remotote preview:

    c3runtime.js:2801 Unhandled exception running script Event sheet 1, event 2, action 6: ReferenceError: List is not defined

    As I said, it all works perfectly well in the preview but not in an exported apk.

    UPDATE:

    I think I managed to force the script to load but now in the apk build it just hangs on the loading screen (presumably when the script loads). There is no information at all in the Chrome remote inspector so I have no idea what the error is.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The solution to all this was to put my list.js file into the files folder and NOT the scripts folder. Everything works now just as it does in the preview.

    I have no idea why though.

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