问题

在网上下载一个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. [日常摸鱼]bzoj4802 欧拉函数-PollardRho大整数分解算法

    啊居然要特判,卡了好久QAQ (好像Windows下的rand和Linux下的不一样? QwQ一些东西参考了喵铃的这篇blog:http://www.cnblogs.com/meowww/p/6400 ...

  2. 《Spring Boot 实战纪实》之关键点文档

    目录 前言 (思维篇)人人都是产品经理 1.需求文档 1.1 需求管理 1.2 如何攥写需求文档 1.3 需求关键点文档 2 原型设计 2.1 缺失的逻辑 2.2 让想法跃然纸上 3 开发设计文档 3 ...

  3. rocketMq 消息偏移量 Offset

    消息偏移量 Offset queue0 offset 0   0-20  offset 4  20-40 纠错:每条消息的tag对应的HashCode. queue1 offset 1  0-20   ...

  4. iOS 调用系统拍照遇到的坑

    iOS 11之前用的一套图片选择器框架,之前一直没问题,iOS11之后拍照后回调失败......,打断点方法完全执行,也能回调成功:但是去掉断点又恢复不能会调的问题.困扰了一下午,愣是没有解决.后来把 ...

  5. JS C# 正则表达式去除html字符中所有的标签(img em标签除外)

    js去除em标签 $(this).html().replace(/<(?!em|\/em).*?>/g, '') C#去除 System.Text.RegularExpressions.R ...

  6. 【PY从0到1】第六节 用户输入while循环

    # 6 第六节 用户输入while循环 # 1> 重要的函数--input() # 我们先讲解一下input():当Python碰到input()后会执行括号内的语句. # 随后等待用户的输入. ...

  7. (十三)、向shell脚本中传参

    一.向脚本中传递位置参数 向脚本中传递参数的数目理论上可以无数多,但是只有前9个能被访问,使用shift可以改变此限制 $0 $1 $2 $3 $4 $5 $6 $7 $8 $9 脚本名字 first ...

  8. 【mybatis-plus】主键id生成、字段自动填充

    一.主键id的生成 数据库表里通常都会有一个主键id,来作为这条数据的唯一标识. 常见的方式 数据库自动增长 这种很常见了,可以做到全库唯一.因为id是天然排序的,对于涉及到排序的操作会很方便. UU ...

  9. iOS崩溃治理--开篇

    去年我开始负责iOS崩溃治理的工作,从原来的万分之五崩溃率,一直到现在的万分之一左右的崩溃率,期间踩了很多坑,因此想和大家分享一下,希望能对大家有所帮助,也欢迎大家私信交流. 如果你打算开始治理崩溃的 ...

  10. 2.mysql explain命令详解

    EXPLAIN详解 SQL编写和解析 编写过程 select-distinct-from-join-on-where-group by-having-order by-limit- 解析过程 from ...