compileDebugJava - is not incremental. Unable to infer the source directories

China☆狼群 提交于 2019-12-05 21:33:00

Yes, there is an issue for Android Build Plugin, read here:

We use custom sourceset so this is unlikely to be fixed until we can stop using them.

http://code.google.com/p/android/issues/detail?id=82411 and mentioned here

https://discuss.gradle.org/t/faster-incremental-builds/552/10

When it is fixed, use this for Android, add this in allProjects:

allProjects {
    tasks.withType(JavaCompile) {
        configure(options) {
            incremental = true
        }
    }
}

If you see this, you must build your project first:

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

If you see this, the wrong sourceSets are being used according to the isse(see link):

compileDebugJava - is not incremental. Unable to infer the source directories.

From their example for Java projects:

apply plugin: 'java'
compileJava {
    //enable compilation in a separate daemon process
    options.fork = true

    //enable incremental compilation
    options.incremental = true
}

Source: http://gradle.org/docs/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html

I had such issue with react-native addon packages that I have used. I ran react-native link and it seems to have solved the issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!