问题

在网上下载一个demo,因为版本久远,里面添加了本地 Butter Knife 的jar包,在编译时报错

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.
- butterknife-7.0.1.jar (butterknife-7.0.1.jar) 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.

看提示应该是找不到包,项目配置的问题

按照dependencies中增加annotationProcessor 依赖内容的方法并没有成功

解决方法

在 app 的 build.gradle 文件中添加 includeCompileClasspath 参数:

apply plugin: 'com.android.application'

android {
    ··· defaultConfig {
    ···
// 显式声明支持注解
javaCompileOptions{
annotationProcessorOptions {
includeCompileClasspath true
}
}
} } dependencies {
    ···
implementation files('libs/butterknife-7.0.1.jar')

    ···
}

重新 build 一下

【Android】编译报错 Annotation processors must be explicitly declared now 解决方案的更多相关文章

  1. AndroidStudio3.0 注解报错Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.

    把Androidstudio2.2的项目放到3.0里面去了,然后开始报错了. 体验最新版AndroidStudio3.0 Canary 8的时候,发现之前项目的butter knife报错,用到注解的 ...

  2. Android Studio错误日志-注解报错Annotation processors must be explicitly declared now.

    导入项目时,发现之前项目的butter knife报错,用到注解的应该都会报错Error:Execution failed for task ':app:javaPreCompileDebug'.&g ...

  3. AndroidStudio3.0 注解报错Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.

    体验最新版AndroidStudio3.0 Canary 8的时候,发现之前项目的butter knife报错,用到注解的应该都会报错 Error:Execution failed for task ...

  4. AndroidStudio3.0 Canary 8注解报错Annotation processors must be explicitly declared now.

    体验最新版AndroidStudio3. Canary 8的时候,发现之前项目的butter knife报错,用到注解的应该都会报错 Error:Execution failed for task ' ...

  5. Android Studio 3.0+ Annotation processors must be explicitly declared now

    把Android Studio 升级到3.0+ 版本的时候出现该问题:   可以看到 给了我们两种解决办法:   1. 即 给出现问题的三方 加上 annotationProcessor配置     ...

  6. AS使用lombok注解报错:Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor.

    Rebuild时报错信息如下所示: Error:Execution failed for task ':app:javaPreCompileDebug'.> Annotation process ...

  7. Error:Annotation processors must be explicitly declared now.

    环境 Android Studio 3.0 Gradle 3.0.0 gradle 4.1 Error Error:Execution failed for task ':app:javaPreCom ...

  8. AndroidFine Error:Annotation processors must be explicitly declared now.

    环境 Android Studio 3.0 Gradle 3.0.0 gradle 4.1 Error Error:Execution failed for task ':app:javaPreCom ...

  9. 关于VS编译报错,但是错误信息未提示问题解决方案

    可能代码中引用了别的类库中的函数,然后未编译被引用库导致编译报错,重新编译被引用库然后再编译当前库即可解决问题

随机推荐

  1. 一位弱校选手的oi经历

    锦瑟无端五十弦,一弦一柱思华年. 这只是一位不知道什么时候就要退役的oier在一节晚自习的时候写的无聊东西 曾经也想好好写一写自己的oi历程,也许会有人看,不过因为自己懒加上文笔差也一直没写,直到昨天 ...

  2. angular8 在componet里面跳转新的地址页面

    this.router.navigate(['/teacher/course/detail/' + id]);

  3. Java篇:Docker的介绍安装 和常用命令

    文章目录 为什么 出现docker Docker的简介 容器(Container) 镜像(Image) 仓库(Repository) Docker的安装 查看容器 删除镜像 删除容器 部署应用 以my ...

  4. 干货满满:python实现二维图制作

    python全代码如下 import re import csv import matplotlib.pyplot as plt x=[] y=[] m=eval(input()) #输入折线条数 f ...

  5. 【k8s实战一】Jenkins 部署应用到 Kubernetes

    [k8s实战一]Jenkins 部署应用到 Kubernetes 01 本文主旨 目标是演示整个Jenkins从源码构建镜像到部署镜像到Kubernetes集群过程. 为了简化流程与容易重现文中效果, ...

  6. Python的一个mysql实例

    按公司名统计一定时期内入货的总车数,总重量还有总价格.数据表如下: 要用到的库是pymysql,读取excel表格的xlrd,写入excel的xlwt和复制excel模板的xlutils,代码如下: ...

  7. 解决[BScroll warn]: Can not resolve the wrapper DOM. Vue better-scroll

    在开发项目过程中,使用better-scroll插件中遇到了滚动一次重复提示相同错误 [BScroll warn]: Can not resolve the wrapper DOM. Vue bett ...

  8. 生成对抗网络(Generative Adversarial Networks, GAN)

      生成对抗网络(Generative Adversarial Networks, GAN)是一种深度学习模型,是近年来复杂分布上无监督学习最具前景的学习方法之一.   GAN 主要包括了两个部分,即 ...

  9. 实验1 C语言开发环境使用和编程初体验

    #include <stdio.h> #include <stdlib.h> int main() { printf ("202083290273\n2020 ,wh ...

  10. 当Thymeleaf遇到向js中传值的操作

    在使用Thymeleaf的时候.关于一些点击操作非常头疼.往往需要向JS里面传递各种东西. 然而,在用Thymeleaf的时候.js操作需要拼接语句.但是又不好拼接. 关于一些操作,一般也是在表格中. ...