[Construct 2] Black Screen


Same happens on my end. Once the layout with the physic objects comes up, it crashs and stops working.
I use

  • Construct 2 r210 beta
  • Box2Dweb
  • Canvas+

This is the error I get in the developer app.

JavaScript Exception (Tag: 'requestAnimationFrame'): TypeError: undefined is not a function
at new Box2D.Dynamics.b2FixtureDef (c2runtime.js:25938:16)
at behinstProto.createBody (c2runtime.js:31868:16)
at behinstProto.tick (c2runtime.js:32103:9)
at Runtime.logic (c2runtime.js:5115:29)
at Runtime.tick (c2runtime.js:5016:8)
at tickFunc (c2runtime.js:3846:47)

The runtime file:
I tried to upload it but I guess the uploader just accepts images, so just check my Project “ZombieAttack”. There you can see the c2runtime.js file for further information.

Construct 2 Compilations not working

We will have a look at it. Thank you for the test case.



Any news on this? I have the exact same problem, Construct2 r210, box2d.web



We have been trying but we can’t reproduce the error. We have enabled the zip upload in the forums so if anyone could upload a Construct2 project with a minimum test case of the issue that will definitely help us a lot solving the issue.


@imanolm1 I dont know how to upload to forums. Anyway here are all the files in dropbox needed for testing.

· The zip file exactly as i upload to cocoon for compile (Exported with cordova without minify): https://www.dropbox.com/s/0itebhanjcwggi5/testcocoon.zip?dl=0

· The capx file to open with construct2: https://www.dropbox.com/s/u1tanjikgg7wegx/testcocoon.capx?dl=0

· The apk file compiled in cocoon: https://www.dropbox.com/s/el4goc6uzyc5dkz/android-armv7-debug.apk?dl=0

· The developer app compiled in cocoon: https://www.dropbox.com/s/kvf5blepumv8b6z/devapp-android-armv7-debug.apk?dl=0

EDIT: I’ve seen the option to upload now. Tell me if you want the upload here.



I’ve made some tests with the testcase sent by @Mamajua and it works correctly if I make an HTML5 export of the project. For some reason the zipped exported project @Mamajua has attached doesn’t work fine. What kind of export are you doing HTML5, Cordova?. Also it may help if you remove all the old Cocoon plugin files you have in Construct2 and install only the latest plugin version from here: https://github.com/CocoonIO/cocoon-plugins-c2.

Could you try export that same capx with HTML5/Cordova and see if any of those exports work correctly?. Let¡s see if we can track down this issue.

Thanks for the files, have been really helpful!


@imanolm1 I’m using cordova exporter and in construct2 i’m using the latest plugin for cocoon. If i open the caproj file inside capx file, with Notepad++ i see this plugins and behaviours used:

        <plugin author="Ludei" id="Cocoon_Canvasplus" version="1">Cocoon Canvasplus</plugin>
        <plugin author="Scirra" id="Sprite" version="1">Sprite</plugin>
        <plugin author="Scirra" id="Spritefont2" version="1">Sprite font</plugin>
        <plugin author="Scirra" id="Text" version="1">Text</plugin>
        <plugin author="Scirra" id="Touch" version="1">Touch</plugin>
        <behavior author="Scirra" id="Physics" version="1">Physics</behavior>
        <behavior author="Scirra" id="Sin" version="1">Sine</behavior>

And in this pic i show how i have exported the test project:

Thanks for tracking this issue!


Ive exported the test with “HTML5 Website” and compiled in cocoon and its works ok, the only problem is that the screen is at left bottom corner of the screen, ignoring the fix for c2runtime.js (“this.isCocoonJs”).

Ive checked the two exported projects, one in cocoon and one in html5 website, and the only diference is the file index.html, the others are exact. I dont know if this can help you in any way, but thanks again for tracking this and sorry for my english.


@imanolm1 Any news on this? have you found the problem? Tell me if i can help testing or making testcases.


We haven’t forget about this, just trying to find some time to keep on testing. Apparently there’s some difference between the HTML5 exporter and the Cordova one that breaks the Physics but as I said I need to test some more.

Probably Construct2 people can shed some light on this faster than us as they make the exporters.

I’ll take a look at this this week.


I added a ‘Troubleshooting’ page showing some issues and a way how to solve them.
I also found a solution to fix the ‘Black Screen’ issue.


I will give my best to keep this page up to date, so if you have some new issues with fixes, please let me know then :smiley:


It isn’t fix layouts with physics objects


That’s a bug ludei is still working on.


Any update on the issue?.


I think they are working on it. @imanolm1 i tried with webview+ and it works ok, but we need Canvas+ :smile:


Any update @imanolm1 ?


I’ve been having the black screen issue since the beginning. Project runs in Webview, but always black screens with Canvas and Physics… I would love to hear for an update on this now that Cocoon is not in beta.


Kinda surprised that you guys did a full release without fixing this black screen issue. Physics pretty much don’t work on Canvas.


Same problem. But on “webview+” - white screen…
Physics - Box2D web, custom loadscreen, no mouse or keyboard, deleted “browser” and “cocoonjs” plugins.


Physics only runs in standard Webview for now or at least that’s how it goes on my side. Can you not compare how Webview and Canvas+ read Physics and you might find the issue there. I don’t think the issue comes from the Cordova exporter and Construct 2.


I don’t understand what you doing, but on my devices with webview or webview+ - white screen.