升级了android studio 3.4版本,突然发现之前写的自定义注解不能生成文件了,调试了一下发现自定义注解处理器中的函数没有执行,有人遇到过这种情况么?求解决方案!

解决方案 »

  1.   

    在rebuild后出现如下提示
    > Task :app:compileDebugJavaWithJavac
    Gradle may disable incremental compilation as the following annotation processors are not incremental: auto-service-1.0-rc5.jar (com.google.auto.service:auto-service:1.0-rc5).
    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.不知是否与这个问题相关?
      

  2.   

    在gradle.properties中添加 android.enableSeparateAnnotationProcessing = true 这行代码
      

  3.   

    使用的google的那个autoService吧?要使用annotationProcessor这个库,然后如果报找不到这个类,加上compileOnly 这个库