title: Cordova build | Run failed - compileDebugJavaWithJavac
body: <p>I have a problem with building my <strong>Android platform</strong> on <strong>Apache Cordova</strong>. </p>
  
  <p>Version numbers:</p>
  
  <ul>
  <li>Android @5.0.1 (Samsung galaxy S4)</li>
  <li>Cordova @6.1.1 (updated from 5.1.1 on 07/04/2016)</li>
  <li>Ionic @1.7.14</li>
  <li>Windows @7</li>
  </ul>
  
  <p>I could build my project yesterday, but since today I get errors when trying to build or run my cordova app. I have tried to remove and add my android platform, but that didn't work (it only made thing worse). </p>
  
  <hr>
  
  <p><strong>Execution failed</strong></p>
  
  <p>When I run "<em>Cordova build android</em>" or "<em>Cordova run android</em>" I get the following error:</p>
  
  <blockquote>
    <p>Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.</p>
    
    <p>Compilation failed; see the compiler error output for details.</p>
  </blockquote>
  
  <p>The stacktrace gives the following:</p>
  
  <blockquote>
    <p>:CordovaLib:compileDebugJavaWithJavac C:\Users\me\Desktop\myProjects\testProject\platforms\android\CordovaLib\src\org\apache\cordova\CordovaInterfaceImpl.java:222: error: cannot find symbol getActivity().requestPermissions(permissions, requestCode);</p>
  </blockquote>
  
  <p>I cannot seem to resolve this error. I have a valid java path in my environment variables and I have installed the following <strong>Android SDK build tools</strong>: </p>
  
  <ul>
  <li>23.0.3</li>
  <li>23.0.2</li>
  <li>23.0.1</li>
  <li>22.0.1</li>
  <li>21.1.2</li>
  <li>20</li>
  <li>19.1</li>
  </ul>
  
  <hr>
  
  <p><strong>What I tried</strong></p>
  
  <p>I tried <em>cordova platform add android@5.0.1</em>, but that gives me <em>unknown platform version</em>. So I have to set it to version 21 manually in the <strong>Android manifest</strong> and <strong>project.properties</strong>. </p>
  
  <p>Also if I run <em>cordova platform add android@5.1.1</em> cordova somehow overrides this and installs the platform for android version 23 (6.0). </p>
  
  <p>I tried downgrading to Cordova version 5.1.1, but that still gave me the same error. </p>
  
  <p>I tried changing the Java path, with no result. </p>
  
  <p>I updated my Android SDK tools and Android SDK platform tools, No difference.</p>
  
  <hr>
  
  <p><strong>Solution</strong></p>
  
  <p>It seemed that my npm_cache was corrupt. I had to remove it, so that it was recreated by Cordova. After this I could build and run again. 
  <em>File location:</em> C:\Users\.cordova\lib 
  and then remove the npm_cache folder. </p>