升級了android studio 3.4版本,突然發現之前寫的自定義注解不能生成檔案了,除錯了一下發現自定義注解處理器中的函式沒有執行,有人遇到過這種情況么?求解決方案!
uj5u.com熱心網友回復:
在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.
不知是否與這個問題相關?
uj5u.com熱心網友回復:
在gradle.properties中添加 android.enableSeparateAnnotationProcessing = true 這行代碼uj5u.com熱心網友回復:
使用的google的那個autoService吧?要使用annotationProcessor這個庫,然后如果報找不到這個類,加上compileOnly 這個庫轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/130731.html
標籤:Android
下一篇:微信定位有辦法破解嗎
