Ionic-cli: :CordovaLib:compileDebugJavaWithJavac FAILED

Created on 6 Sep 2016  路  4Comments  路  Source: ionic-team/ionic-cli

_From @PterPmnta on September 4, 2016 22:59_

Trying to compile my project using ionic build android , I have encountered an error.
I have tried all the proposed solutions I found on questions asked in other sites, but dont work

I tried

  1. Update cordova -- cordova platform update android, after ionic build android
  2. Remove android platform and add again
  3. Delete nmp_cache folder

The error is only happening with newly created projects , projects which are installed some time ago back , work without any problem .

Your system information:

Cordova CLI: 6.3.1
Ionic Framework Version: 1.3.1
Ionic CLI Version: 2.0.0
Ionic App Lib Version: 2.0.0
OS:
Node Version: v5.5.0

The error:

C:\Users\pedromiguel\aplicacionesIonic\testpushApp>ionic build android
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\testpushApp\hooks\after_prepare\010_add_platform_class.js C:\Users\pedromiguel\aplicacionesIonic\testpushApp


add to body class: platform-android

ANDROID_HOME=C:\Users\pedromiguel\AppData\Local\Android\sdk

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_101

Incremental java compilation is an incubating feature.


:preBuild

UP-TO-DATE

:preDebugBuild
 UP-TO-DATE

:checkDebugManifest


:CordovaLib:preBuild

UP-TO-DATE


:CordovaLib:preDebugBuild
 UP-TO-DATE
:CordovaLib:compileDebugNdk
 UP-TO-DATE


:CordovaLib:compileLint


:CordovaLib:copyDebugLint
 UP-TO-DATE


:CordovaLib:mergeDebugProguardFiles

UP-TO-DATE

:CordovaLib:packageDebugRenderscript
 UP-TO-DATE

:CordovaLib:checkDebugManifest


:CordovaLib:prepareDebugDependencies


:CordovaLib:compileDebugRenderscript
 UP-TO-DATE


:CordovaLib:generateDebugResValues
 UP-TO-DATE


:CordovaLib:generateDebugResources
 UP-TO-DATE

:CordovaLib:packageDebugResources
 UP-TO-DATE


:CordovaLib:compileDebugAidl

UP-TO-DATE

:CordovaLib:generateDebugBuildConfig
 UP-TO-DATE


:CordovaLib:mergeDebugShaders
 UP-TO-DATE

:CordovaLib:compileDebugShaders
 UP-TO-DATE

:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets
 UP-TO-DATE


:CordovaLib:processDebugManifest
 UP-TO-DATE


:CordovaLib:processDebugResources
 UP-TO-DATE


:CordovaLib:generateDebugSources
 UP-TO-DATE

:CordovaLib:incrementalDebugJavaCompilationSafeguard
 UP-TO-DATE


:CordovaLib:compileDebugJavaWithJavac


:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

:CordovaLib:compileDebugJavaWithJavac FAILED



FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.

> java.io.FileNotFoundException: C:\Users\pedromiguel\.gradle\caches\2.13\classAnalysis\cache.properties (El sistema no puede encontrar el archivo especificado)


BUILD FAILED



* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Total time: 1 mins 8.24 secs

Error: cmd: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':CordovaLib:compileDebugJavaWithJavac'.
> java.io.FileNotFoundException: C:\Users\pedromiguel\.gradle\caches\2.13\classAnalysis\cache.properties (El sistema no puede encontrar el archivo especificado)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

After of many times to try cordova platform update android, this show:

C:\Users\pedromiguel\aplicacionesIonic\testpushApp>cordova platform update android
Updating android project...
Android project updated with [email protected]
Running command: "C:\Program Files\nodejs\node.exe" C:\Users\pedromiguel\aplicacionesIonic\testpushApp\hooks\after_prepare\010_add_platform_class.js C:\Users\pedromiguel\aplicacionesIonic\testpushApp
add to body class: platform-android

After compiled using ionic build android, but dont work, show the same error.

_Copied from original issue: driftyco/ionic#7968_

old major version

Most helpful comment

If anyone figures out this error please post!

All 4 comments

If anyone figures out this error please post!

I got this error on Ubuntu 16

@leon3s i update the android studio, now work fine.

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

Was this page helpful?
0 / 5 - 0 ratings