Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Pablo_R_1
Beginner
72 Views

Intel XDK Cocos2d games template wont run (out of the box)

Hello

When I create a project based on the Template: Games > Cocos2d 3.7 > HTML5+Cordova

And then, out of the box, I run it through the SIMULATE tab, all I see on the virtual emulator is a blank screen.

Opening the debug panel (and refreshing the app so I see the full trace since the beginning of the execution), these are the javascript errors I see:

  • Uncaught ReferenceError: global is not defined (program):4
  • Uncaught TypeError: Cannot set property 'onStart' of undefined main.js:50
  • Uncaught module cordova-plugin-device.device already defined cordova.js:79
  • Uncaught module cordova-plugin-splashscreen.SplashScreen already defined cordova.js:79
  • Uncaught module cordova-plugin-statusbar.statusbar already defined cordova.js:79

My system: Windows 10 + Intel XDK 3491

I am pretty sure the problem is related to the first error, but I cannot find anything on how to solve it.

There are other cocos2d templates that will run out of the box, but they have much more code on them. I want to start out of a helloworld project.

Thanks!!

Tags (2)
0 Kudos
13 Replies
PaulF_IntelCorp
Employee
72 Views

Pablo_R_1
Beginner
72 Views

Thanks Paul. I believe that post is related to signing certificates. My problem is related to the simulations within the intel xdk (no signing needed as far as I know).

It is bizarre that this template doesn't runs. I could be doing something wrong, but it doesn't looks like it... I just install the intel sdk, create a new project based on the mentioned template and simulate it... then boom, I get those errors and nothing is shown on the simulated app (while the cocos image should be displayed)

 

PaulF_IntelCorp
Employee
72 Views

There is a known issue with the Simulate tab, due to a recently discovered Cordova bug, that causes the Simulate tab to fail if the project has zero plugins. Simplest workaround is to add the Cordova "device" plugin to your project.

Pablo_R_1
Beginner
72 Views

I just tried that and it didn't worked. Actually I think there is something with the source code/set up of that template. I've been able to simulate other templates with no issue, but for this specific one...which incidentally is the one I'd like to use :´(

I think the template is not working for other users either... but I can't really find anyone mentioning it so maybe it's just me :S

PaulF_IntelCorp
Employee
72 Views

Pablo -- the Game Asset Manager has been deprecated and will be removed in a future version of the XDK, one of the reasons those game templates haven't been getting much attention. See if this FAQ addresses the issue you're encountering > https://software.intel.com/en-us/xdk/faqs/cordova#cocos2d-ios-fix <

Mikael_E_
Beginner
72 Views

You arent alone Pablo R. No one of my old cocos2D projects work. And i have Same problem with the new template just like Pablo. Paul It has nothing to do with ios. New/Old Cocos projects wont work in Simulate. Not ever a new cocos2d template.

I tryed two different computers, re boot, re install intelXDK. same problem. 

PaulF_IntelCorp
Employee
72 Views

Please attach a ZIP of the ENTIRE project folder that does not work so I can reproduce the issue. Use the "Attach Files to Post" link below the edit window to attach the ZIP to your post. The simpler the example the better.

Mikael_E_
Beginner
72 Views

Here you have a screenshot, of a newly created cocos2d project with console open. Simulator just show a black screen.

Mikael_E_
Beginner
72 Views

Screenshot and zip file

PaulF_IntelCorp
Employee
72 Views

Mikael -- updating the Cocos2d js file in the project resolves the issue. You can download a Cocos2d JS file by going to their "builder" page and selecting what you want. I tried both the Lite version and the Full version (3.12) and both worked. Here's their builder: http://cocos2d-x.org/filecenter/jsbuilder/

PaulF_IntelCorp
Employee
72 Views

Mikael -- use the "full" version, Lite is not good enough for many of the sample apps.

Mikael_E_
Beginner
72 Views

It worked :D thanks

PaulF_IntelCorp
Employee
72 Views

BTW -- we discovered that sometimes the Simulate tab's touch simulation does not "kick in" soon enough. The workaround is to refresh your app in the Simulate tab after starting it and then touch simulation should work. We have a fix in the works for the next release.

Reply