7 Replies Latest reply on Oct 27, 2016 4:59 AM by Marcos Cardoso Martins

    CreateJS game stop before load assets (Android - Cloud Build Service)

    Marcos Cardoso Martins

      I made a crossword game using CreateJS (https://code.createjs.com/createjs-2015.11.26.min.js ) that works perfectly on web browsers. See it here.

      In the game you have to drag and drop letters to the spaces to form words.


      Now I'm using the Phonegap clould service to make android builds. Version 3.7.0 of Cordova worked in my Moto G with Android 5.1. But when I tryied to update the version to "CLI-6.3.0" the game showed odd behaviour. The game open but stops before preloading the assets. Then I can see only the background.


      Using some alerts in my code I realize the game stop before instantiating the stage:

      stage = new createjs.Stage(canvas);

      but I don't know if that is the problem.


      This is a piece of my js code:

      var canvas, stage, exportRoot;

      function init()


                  canvas = document.getElementById("canvas");

                  // alert(0);

                  alert("Canvas: " + canvas);

                  stage = new createjs.Stage(canvas);

                  // alert(1);



                  createjs.Ticker.addEventListener("tick", tick);

                  wide = window.innerWidth > Common.limitHorizontal;


                  preloader = new Preloader(manifest);



      <body onload="init();" style="margin:0px;">

        <canvas id="canvas" width="960" height="550"></canvas>



      My project is on github: GitHub - marcoscardosomartins/Cruzadinhas.


      Tests in Moto G - Android 5.1

      No Plugins used.


      My project structure is this:

      Root folder












      <?xml version="1.0" encoding="UTF-8"?>

      <widget xmlns     = "http://www.w3.org/ns/widgets"

              xmlns:gap = "http://phonegap.com/ns/1.0"

              id        = "br.com.noas.cruzadinhas"

              version   = "1.0.2">



              Complete as cruzadinhas de acordo com o nome das imagens.


          <author href="http://www.noas.com.br" email="marcos@noas.com.br">

              Noas Team


          <gap:platform name="android" />

          <preference name="permissions"                value="none"/>

          <preference name="orientation"                value="landscape" />        <!-- all: default means both landscape and portrait are enabled -->

          <preference name="target-device"              value="universal" />      <!-- all: possible values handset, tablet, or universal -->

          <preference name="fullscreen"                 value="true" />           <!-- all: hides the status bar at the top of the screen -->

          <preference name="splash-screen-duration"     value="10000"/>           <!-- android -->

          <preference name="android-minSdkVersion"      value="7" />              <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->

          <preference name="android-installLocation"    value="auto" />           <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->

          <preference name="KeepRunning"                value="true"/>

          <icon src="www/images/icone.fw.png" />

          <icon src="www/icons/icon-36-ldpi.png"   platform="android"    density="ldpi" />

          <icon src="www/icons/icon-48-mdpi.png"   platform="android"    density="mdpi" />

          <icon src="www/icons/icon-72-hdpi.png"   platform="android"    density="hdpi" />

          <icon src="www/icons/icon-96-xhdpi.png"  platform="android"    density="xhdpi" />

          <gap:splash src="www/icons/splash-LDPI.png"  gap:platform="android" gap:density="ldpi" />

          <gap:splash src="www/icons/splash-MDPI.png"  gap:platform="android" gap:density="mdpi" />

          <gap:splash src="www/icons/splash-HDPI.png"  gap:platform="android" gap:density="hdpi" />

          <gap:splash src="www/icons/splash-XHDPI.png" gap:platform="android" gap:density="xhdpi" />

          <access origin="*"/>

          <allow-intent href="https://*/*"/>

          <allow-navigation href="https://*/*"/>



      My question is: Why my game stops just after open?


      Thanks in advance.