title: Android Cordova app crash on startup: Channel is unrecoverably broken and will be disposed
body: <p>I have an app that behaves fine in ios, but crashes on Android devices on startup.  Some. Not all. It crashus a Nexus 7 running lollipop, works fine on a Pixel 2 running Nougat. When I test it at Amazon's Device Testing service, I get this mixed bag of results:</p>
  
  <p><a href="https://i.stack.imgur.com/ELiGW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ELiGW.jpg" alt="Amazon Kindle device crash list"></a></p>
  
  <pre><code>--------- beginning of crash
      02-22 12:47:02.587 18315-18370/net.mydomain.bingo A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 18370 (Thread-399)
      02-22 12:47:02.930 1139-1139/? E/EGL_emulation: tid 1139: eglCreateSyncKHR(1865): error 0x3004 (EGL_BAD_ATTRIBUTE)
      02-22 12:47:02.933 1499-1616/system_process E/InputDispatcher: channel '32d81f42 net.mydomain.bingo/net.mydomain.bingo.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
      02-22 12:47:02.934 1499-1616/system_process E/InputDispatcher: channel '176d8224 net.mydomain.bingo/net.mydomain.bingo.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
      02-22 12:47:02.934 1499-1616/system_process E/InputDispatcher: channel '3bf3ddb6 net.mydomain.bingo/net.mydomain.bingo.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
      02-22 12:47:02.979 1136-1136/? E/lowmemorykiller: Error opening /proc/18315/oom_score_adj; errno=2
  </code></pre>
  
  <p>Amazon graphs memory use, and it never approaches the heap limit on any of the reports. CPU use rises to around 30% on load, but does the same on the devices that successfully run the thing. How can I get a more helpful report of what's going on here than </p>
  
  <pre><code>Channel is unrecoverably broken and will be disposed!
  </code></pre>
  
  <p>That gives me no indication where in my mainactivity code I'm going wrong. My suspicion is a block of code that loads a bingo board into a set of two arrays:</p>
  
  <pre><code>$(document).ready(function() {
  
      $('body').on('touchmove', false);
  
  //  $('#header').append(headerText);
      $('#header').append(headerImage);
  
  
      $('#footer').append(footerText);
      shuffle(JSONBingo.squares);
  
      for (i=0; i&lt;24; i++)    {
          if (i==12) {
              $('#board').append("&lt;div data-value='1' class='selected freesquare' id='sqfree'&gt;&lt;p class='text hyphens noselect'&gt;&lt;br/&gt;free space&lt;/p&gt;&lt;/div&gt;");
              $('#board').append("&lt;div data-value='0' class='square' id='sq12'&gt;&lt;p class='text hyphens noselect'&gt;&lt;br/&gt;"+JSONBingo.squares[i].square+"&lt;/p&gt;&lt;/div&gt;");
          } else {
              $('#board').append("&lt;div data-value='0' class='square' id='sq"+i+"'&gt;&lt;p class='text hyphens noselect'&gt;&lt;br/&gt;"+JSONBingo.squares[i].square+"&lt;/p&gt;&lt;/div&gt;");
  
          }
  
    }
  
  shuffle(JSONBingoPLUS.squaresPLUS);  
  
  for (i=0; i&lt;24; i++)    {
  
          if (i==12) {
              $('#positiveboard').append("&lt;div data-value='1' class='selected freesquarePLUS' id='sqfreePLUS'&gt;&lt;p class='text hyphens noselect'&gt;&lt;br/&gt;free space&lt;/p&gt;&lt;/div&gt;");
              $('#positiveboard').append("&lt;div data-value='0' class='squarePLUS' id='sqp12'&gt;&lt;p class='text hyphens noselect'&gt;&lt;br/&gt;"+JSONBingoPLUS.squaresPLUS[i].squarePLUS+"&lt;/p&gt;&lt;/div&gt;");
          } else {
              $('#positiveboard').append("&lt;div data-value='0' class='squarePLUS' id='sqp"+i+"'&gt;&lt;p class='text hyphens noselect'&gt;&lt;br/&gt;"+JSONBingoPLUS.squaresPLUS[i].squarePLUS+"&lt;/p&gt;&lt;/div&gt;");
          }
  
    }
  
  
      $('div.square').tappable(function ()  {
         cancelOnMove: false;
        if (!event.target.id){ 
        } else {
        $(this).toggleClass('selected');
  
        if ($(this).data('value') == 1) {
  
  
              $(this).data('value', 0);}
        else {
  
              $(this).data('value', 1); 
  
              }
              }
  
  
  
           clickSnd.play();
  
          var row1 = ($('#sq0').data('value')+$('#sq1').data('value')+$('#sq2').data('value')+$('#sq3').data('value')+$('#sq4').data('value'));
          var row2 = ($('#sq5').data('value')+$('#sq6').data('value')+$('#sq7').data('value')+$('#sq8').data('value')+$('#sq9').data('value'));
          var row3 = ($('#sq10').data('value')+$('#sq11').data('value')+$('#sqfree').data('value')+$('#sq12').data('value')+$('#sq13').data('value'));
          var row4 = ($('#sq14').data('value')+$('#sq15').data('value')+$('#sq16').data('value')+$('#sq17').data('value')+$('#sq18').data('value'));  
          var row5 = ($('#sq19').data('value')+$('#sq20').data('value')+$('#sq21').data('value')+$('#sq22').data('value')+$('#sq23').data('value'));          
  
          var col1 = ($('#sq0').data('value')+$('#sq5').data('value')+$('#sq10').data('value')+$('#sq14').data('value')+$('#sq19').data('value'));
          var col2 = ($('#sq1').data('value')+$('#sq6').data('value')+$('#sq11').data('value')+$('#sq15').data('value')+$('#sq20').data('value'));
          var col3 = ($('#sq2').data('value')+$('#sq7').data('value')+$('#sqfree').data('value')+$('#sq16').data('value')+$('#sq21').data('value'));
          var col4 = ($('#sq3').data('value')+$('#sq8').data('value')+$('#sq12').data('value')+$('#sq17').data('value')+$('#sq22').data('value'));    
          var col5 = ($('#sq4').data('value')+$('#sq9').data('value')+$('#sq13').data('value')+$('#sq18').data('value')+$('#sq23').data('value'));            
  
          var diag1 = ($('#sq0').data('value')+$('#sq6').data('value')+$('#sqfree').data('value')+$('#sq17').data('value')+$('#sq23').data('value')); 
          var diag2 = ($('#sq4').data('value')+$('#sq8').data('value')+$('#sqfree').data('value')+$('#sq15').data('value')+$('#sq19').data('value')); 
  
          if (row1 == 5 || row2 == 5 || row3 == 5 || row4 == 5 || row5 == 5 || col1 == 5 || col2 == 5 || col3 == 5  || col4 == 5  || col5 == 5 || diag1 == 5 || diag2 == 5) {
              $('#header').html(loseText);
              $('#header').addClass("lose");
  
              loseSnd.play();
  
          } else {
              $('#header').html(headerImage);
              $('#header').removeClass("lose");
  
          }; 
      });
  
          $('div.squarePLUS').tappable(function ()  {
         cancelOnMove: false;
        if (!event.target.id){ 
        } else {
        $(this).toggleClass('selected');
  
        if ($(this).data('valuePLUS') == 1) {
  
  
              $(this).data('valuePLUS', 0);}
        else {
  
              $(this).data('valuePLUS', 1); 
  
              }
              }
  
  
  
           clickSnd.play();
  
          var row1 = ($('#sqp0').data('valuePLUS')+$('#sqp1').data('valuePLUS')+$('#sqp2').data('valuePLUS')+$('#sqp3').data('valuePLUS')+$('#sqp4').data('valuePLUS'));
          var row2 = ($('#sqp5').data('valuePLUS')+$('#sqp6').data('valuePLUS')+$('#sqp7').data('valuePLUS')+$('#sqp8').data('valuePLUS')+$('#sqp9').data('valuePLUS'));
          var row3 = ($('#sqp10').data('valuePLUS')+$('#sqp11').data('valuePLUS')+$('#sqfreePLUS').data('valuePLUS')+$('#sqp12').data('valuePLUS')+$('#sqp13').data('valuePLUS'));
          var row4 = ($('#sqp14').data('valuePLUS')+$('#sqp15').data('valuePLUS')+$('#sqp16').data('valuePLUS')+$('#sqp17').data('valuePLUS')+$('#sqp18').data('valuePLUS')); 
          var row5 = ($('#sqp19').data('valuePLUS')+$('#sqp20').data('valuePLUS')+$('#sqp21').data('valuePLUS')+$('#sqp22').data('valuePLUS')+$('#sqp23').data('valuePLUS'));         
  
          var col1 = ($('#sqp0').data('valuePLUS')+$('#sqp5').data('valuePLUS')+$('#sqp10').data('valuePLUS')+$('#sqp14').data('valuePLUS')+$('#sqp19').data('valuePLUS'));
          var col2 = ($('#sqp1').data('valuePLUS')+$('#sqp6').data('valuePLUS')+$('#sqp11').data('valuePLUS')+$('#sqp15').data('valuePLUS')+$('#sqp20').data('valuePLUS'));
          var col3 = ($('#sqp2').data('valuePLUS')+$('#sqp7').data('valuePLUS')+$('#sqfreePLUS').data('valuePLUS')+$('#sqp16').data('valuePLUS')+$('#sqp21').data('valuePLUS'));
          var col4 = ($('#sqp3').data('valuePLUS')+$('#sqp8').data('valuePLUS')+$('#sqp12').data('valuePLUS')+$('#sqp17').data('valuePLUS')+$('#sqp22').data('valuePLUS'));   
          var col5 = ($('#sqp4').data('valuePLUS')+$('#sqp9').data('valuePLUS')+$('#sqp13').data('valuePLUS')+$('#sqp18').data('valuePLUS')+$('#sqp23').data('valuePLUS'));           
  
          var diag1 = ($('#sqp0').data('valuePLUS')+$('#sqp6').data('valuePLUS')+$('#sqfreePLUS').data('valuePLUS')+$('#sqp17').data('valuePLUS')+$('#sqp23').data('valuePLUS')); 
          var diag2 = ($('#sqp4').data('valuePLUS')+$('#sqp8').data('valuePLUS')+$('#sqfreePLUS').data('valuePLUS')+$('#sqp15').data('valuePLUS')+$('#sqp19').data('valuePLUS')); 
  
          if (row1 == 5 || row2 == 5 || row3 == 5 || row4 == 5 || row5 == 5 || col1 == 5 || col2 == 5 || col3 == 5  || col4 == 5  || col5 == 5 || diag1 == 5 || diag2 == 5) {
              $('#header').html(winText);
              $('#header').addClass("win");
  
              winSnd.play();
  
          } else {
              $('#header').html(headerText);
              $('#header').removeClass("win");
  
          }; 
      });
  
  });
  
  
  shuffle = function(v){
          for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
          return v;
  };
  </code></pre>
  
  <p>Any ideas? My brain hurts from trying to chase this down for days now...</p>