Android Studio中注解处理器(annotation processors)的增量编译失败分析

导入第三方aar库后,编译出现如下异常:

> Task :app:compileK4t3ReleaseJavaWithJavac FAILED
Gradle may disable incremental compilation as the following annotation processors are not incremental: realm-annotations-processor-3.0.0.jar (io.realm:realm-annotations-processor:3.0.0), butterknife-compiler-8.8.1.jar (com.jakewharton:butterknife-compiler:8.8.1), classes.jar (******.aar).
Consider setting the experimental feature flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file to run annotation processing in a separate task and make compilation incremental.

Execution failed for task ':app:compileK4t3ReleaseJavaWithJavac'.
> Invalid signature file digest for Manifest main attributes

根据提示是由于gradle不支持注解处理器的增量编译导致的编译失败,根据提示,可在gradle.properties中加入android.enableSeparateAnnotationProcessing=true设置来解决;
增量编译功能是与 Gradle 4.10.1 及更高版本兼容的,但由于 Gradle问题,与 Gradle 5.1 并不兼容,故在gradle5.1.1版本中不能通过添加android.enableSeparateAnnotationProcessing=true设置来解决该编译失败问题。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值