R171 WebStorage + CocoonJS 2.0 Bug (and solution)

Bugs will be moved here once resolved.

Post » Tue Jun 10, 2014 8:41 am

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

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.
Image

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.
B
83
S
23
G
14
Posts: 389
Reputation: 12,529

Post » Tue Jun 10, 2014 4:08 pm

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.
Scirra Founder
B
399
S
236
G
89
Posts: 24,535
Reputation: 195,412

Post » Tue Jun 10, 2014 4:37 pm

@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 :D
B
83
S
23
G
14
Posts: 389
Reputation: 12,529

Post » Wed Jun 11, 2014 11:37 am

@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.
Scirra Founder
B
399
S
236
G
89
Posts: 24,535
Reputation: 195,412

Post » Wed Jun 11, 2014 11:50 am

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.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Wed Jun 11, 2014 11:55 pm

@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 ? :D

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

Image
B
83
S
23
G
14
Posts: 389
Reputation: 12,529

Post » Thu Jun 12, 2014 12:01 am

@Silverforce

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.
B
83
S
23
G
14
Posts: 389
Reputation: 12,529

Post » Sun Jun 15, 2014 2:01 pm

Silverforce wrote: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.
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,908

Post » Sun Jun 15, 2014 4:03 pm

@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.
B
83
S
23
G
14
Posts: 389
Reputation: 12,529

Post » Sun Jun 15, 2014 4:48 pm

tumira wrote:@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 ;)
Image Image iTunes: Match3 | Google Play: Match3
B
103
S
37
G
31
Posts: 1,164
Reputation: 28,908

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests