美文网首页
build.gradle & Annotation proces

build.gradle & Annotation proces

作者: 南窗云 | 来源:发表于2018-08-13 17:33 被阅读0次

编译成功,但是运行时报错。

 Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
    - compiler-4.7.1.jar (com.github.bumptech.glide:compiler:4.7.1)

发现:

build.gradle 中 用错了api

    api deps.glide.runtime
    api deps.glide.compiler

修改为

    api deps.glide.runtime
    kapt deps.glide.compiler

就好了。

// 附清单
def glide = [:]
glide.runtime = "com.github.bumptech.glide:glide:$versions.glide"
glide.recyclerview = "com.github.bumptech.glide:recyclerview-integration:$versions.glide"
glide.compiler = "com.github.bumptech.glide:compiler:$versions.glide"
deps.glide = glide

关于Kapt

详细报错如下:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lib_nim:javaPreCompileDebug'.
> Annotation processors must be explicitly declared now.  The following dependencies on the compile classpath are found to contain annotation processor.  Please add them to the annotationProcessor configuration.
    - compiler-4.7.1.jar (com.github.bumptech.glide:compiler:4.7.1)
  Alternatively, set android.defaultConfig.javaCompileOptions.annotationProcessorOptions.includeCompileClasspath = true to continue with previous behavior.  Note that this option is deprecated and will be removed in the future.
  See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7s

相关文章

网友评论

      本文标题:build.gradle & Annotation proces

      本文链接:https://www.haomeiwen.com/subject/ugbubftx.html