问题描述:

I am trying to setup Ionic on my new machine but I have ran into a problem with building a Cordova Android project, that I cannot seem to fix.

The programs and versions I use are:

  • NodeJS v6.9.1
  • npm v3.10.8
  • Cordova v6.4.0
  • Ionic v1.3.22
  • Apache Ant 1.9.7
  • Windows 7 SP1

For building I use Java 8:

  • JAVA_HOME: C:\Program Files\Java\jdk1.8.0_112
  • Java version: 1.8.0_112

For building my android project I use SDK version 21 (5.0.1)

I have created an Ionic started project via the command: ionic start test tabs and didn't change any code of the project.


The errror

While using the command ionic build android I get the error :CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).


What I tried

I Tried running running cordova update and after that ionic build - This did not work.

After that I tried using an other java jdk version (1.8.0_45). The setup on my old machine was working with this version. I also changed the JAVA_HOME variable with this attempt. Unfortunately I had no luck with this attempt.

On multiple topics it is suggested to use JDK 8, because JDK 7 is not compatible with android versions 21 and up. But I get this error while using JDK 8 so that doesn't solve my problem.

I tried removing the android platform and readd it. That also did not solve my problem. It gave me the same error message.


Additional information

Adding the Android platform via the Ionic command ionic platform add [email protected] gives me an error. It does not know that version number (but according to Android SDK manager 5.0.1 = android 21).

Using ionic platform add [email protected] gives me android version 23. So that does not work either.

Because of the problems above I manually changed the version numbers in the Android platform. I changed the version number to 21 on the following places:

  • test\platforms\android --> AndroidManifest.xml
  • test\platforms\android --> project.properties
  • test\platforms\android\CordovaLib --> project.properties

I have had no problem before with changing the version numbers before.

网友答案:

Try to Update your JRE and JDK and IONIC as well.

相关阅读:
Top