zl程序教程

您现在的位置是:首页 >  Java

当前栏目

incremental out directory should be set to aar output directory

2023-02-18 16:34:02 时间

转载请以链接形式标明出处: 本文出自:103style的博客


Android Studio : 3.5.2

编译没问题,运行的时候 报错信息如下:

Cause: failure, see logs for details. incremental out directory should be set to aar output directory.

然后开始google, 有个类似的问题 stackoverflow-questions-53008162, 说是 dataBinding 的问题, 说是直接注释掉,然而并没有卵用…

后面经过多方查阅, 最终在 data-binding 的官方介绍 中看到使用 dataBinding 只需要配置:

android {
    ...
    dataBinding {
        enabled = true
    }
}

然后我发现功能里面多了一个 annotationProcessor 'com.android.databinding:compiler:2.3.0', 然后注释掉这个,运行就可以了,就可以了…

修改 build.gradle

...
android {
    ...
    dataBinding {
        enabled = true
    }    
}
dependencies {
    ...
    annotationProcessor 'com.android.databinding:compiler:2.3.0'
}

...
android {
    ...
    dataBinding {
        enabled = true
    }    
}
dependencies {
    ...
    //annotationProcessor 'com.android.databinding:compiler:2.3.0'
}

维护老项目是真的难受…

类似的问题可以在 build.gradle 中 搜索 annotationProcessor 这个,然后看下最新的官方介绍这个库的使用方法。


如果觉得不错的话,请帮忙点个赞呗。

以上