title: Unhandled Promise Rejection Warning (Cordova Angular)
body: <p>When I execute in the cmd <code>cordova run android</code>, it returns:</p>
  
  <pre><code>Android Studio project detected
  (node:6824) UnhandledPromiseRejectionWarning: Unhandled Promise Rejection (rejection id: 1): Operation Failed
  (node: 6824) [DEP0018] DeprecationWarning: Unhandled Promise Rejections are deprecated. In the future, promise rejections 
  that are not handled will terminate the node.js process with a non-zero exit code.
  </code></pre>
  
  <p>I don't understand the problem, if you have any advice for me. I've already read some other answers to this problem on stackoverflow but..
  This is my code just below for </p>
  
  <pre><code>module.exports = function(ctx) {
  // make sure android platform is part of build 
  if (ctx.opts.platforms.indexOf('android') &lt; 0) {
      return;
  }
  var fs = ctx.requireCordovaModule('fs'),
      path = ctx.requireCordovaModule('path'),
      deferral = ctx.requireCordovaModule('q').defer();
  
  var platformRoot = path.join(ctx.opts.projectRoot, 'platforms/android');
  var apkFileLocation = path.join(platformRoot, 'build/outputs/apk/android-debug.apk');
  
  fs.stat(apkFileLocation, function(err,stats) {
      if (err) {
           deferral.reject('Operation failed');
      } else {
          console.log('Size of ' + apkFileLocation + ' is ' + stats.size +' bytes');
          deferral.resolve();
      }
  });
  
  return deferral.promise;};
  </code></pre>
  
  <p>Thanx for your help.</p>