R171 WebStorage + CocoonJS 2.0 Bug (and solution)

0 favourites
  • 11 posts
From the Asset Store
Globals 2.0
$3.99 USD
Globals 2.0 stores and group variables. You can also load and save data (variables) from/to JSON files.
  • Problem Description

    When I run my game preview via wifi, CocoonJS launcher complain about the webstorage

    Attach a Capx

    I dont think you need capx. I just load empty project and add Webstorage object and preview via wifi.

    Description of Capx

    I dont think you need capx. I just load empty project and add Webstorage object and preview via wifi.

    Steps to Reproduce Bug

    • Create new empty project
    • Add Webstore. No event or anything.
    • Preview via CocoonJS launcher on Android. (Galaxy S3 4.3)

    Observed Result

    Annoying alert message from CocoonJS. And I think Webstorage is broken.

    On Ipad it is working fine.

    Expected Result

    Webstorage just work and no annoying message.

    Affected Browsers

    • Chrome: (NO)
    • FireFox: (NO)
    • Internet Explorer: (NO)

    Operating System and Service Pack

    Windows 8.1 64Bit

    Construct 2 Version ID

    R164.2 until R171. I just stopped and look for fix.

    Solution is here http://docs.moodle.org/24/en/Converting_files_to_UTF-8

    Just open the files from webstorage plugin folder in Notepad++ and resave as UTF8. I noticed that the runtime.js is in "UTF8 without BOM" format. So that may be the cause of the problem.

    Hopefully this help anyone that having this problem and I hope you included the fix in next release.

  • I can't figure out why this happens. It must be a CocoonJS bug, please report it to Ludei. Look how it says it's first evaluating it as UTF-8 then says it actually loaded it with ISO-LATIN-1. There's no reason for it to use that encoding, all C2 scripts are already encoded with UTF-8, so it must be loading it wrong and corrupting it within CocoonJS.

  • Ashley

    Like I said, I found that runtime.js is in "UTF8 without BOM" in NotePad++. While others are actually in "UTF8" when you click the Encoding tab. Maybe it is the one that causes the problem? I found out that I`m not the only one with this problem in the CocoonJS thread.

    It is kinda strange though since I did manage to upload one game last month using R167.2 but when I did downgraded the preview still got the same error. I think they maybe did something to the Launcher and make it incompatible with that format or something.

    Anyway the "fix" or solution is quite simple and strange though. And I think you know they will just ignore my complaints

  • tumira - I tried changing it to UTF-8 (with BOM) and it didn't fix it, at least on Android 4.4.2. I'm pretty sure it's a bug Ludei need to fix.

  • Does this happen with an actual CJS compile for you or only preview? I just did mine with R171 and using all 3 versions of the CJS compiler: 1.4.7, 2.0.0 and the latest 2.0.1 and my WebStorage saving works fine.

  • Ashley

    I have installed C2 R172 today and the bug came back. You are right , its not about the runtime.js UTF8 with or without BOM.

    The bug is in common.js. I just do this.

    1)Copy common.js to desktop (since you cannot edit and save in Program Files)

    2)Open common.js in Notepad++

    3)Press spacebar in the editor

    4)Save

    5)Copy and replace back to webstorage plugin folder.

    I've tested in CocoonJS Launcher v2.0.1 via preview with empty project+webstorage and the solution works. Strange right ?

    The file is actually just empty file (with space). I've attached the file if you want to test.

    https://dl.dropboxusercontent.com/u/65841566/common.zip

  • I've tested preview using wifi on Android 4.3 Galaxy S3. On Ipad4 the bug does not happen. Do you test on IOS or Android ? This bug is kinda strange but as you can see Ashley also effected with this bug. So it is not just me.

  • Does this happen with an actual CJS compile for you or only preview? I just did mine with R171 and using all 3 versions of the CJS compiler: 1.4.7, 2.0.0 and the latest 2.0.1 and my WebStorage saving works fine.

    Same here. I can't reproduce this issue. But I have copied the exported cocoonjs file on my Android Device via USB. I don't get any errors with the webstorage. Try the same and copy your cocoonJS file directly on your device via USB (Root folder).

    I also use r171, WebStorage and CocoonJS plugin 2.0 (latest version) and I have no problems. Not in Preview and not after compiling it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • AndreasR

    Thank you for your posting. What OS are you using ? I`m using Windows 8.1 64 Bit.

    This bug is kinda strange, Ashley got it, I also have this bug and some guy at the CocoonJS thread also asked something about this bug since he also encountered it.

    For me, my solution seems to work. I just do what I mentioned above.

  • AndreasR

    Thank you for your posting. What OS are you using ? I`m using Windows 8.1 64 Bit.

    This bug is kinda strange, Ashley got it, I also have this bug and some guy at the CocoonJS thread also asked something about this bug since he also encountered it.

    For me, my solution seems to work. I just do what I mentioned above.

    I also use Win 8.1 64 bit and I also have figured out the problem. It's the "Minify Script" process during the export. Uncheck this and you get no error

  • AndreasR

    Good to know. I try to uncheck minify script if my game have problem after exported.

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