【Android】编译报错 Annotation processors must be explicitly declared now 解决方案
问题
在网上下载一个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 解决方案的更多相关文章
- 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报错,用到注解的 ...
- Android Studio错误日志-注解报错Annotation processors must be explicitly declared now.
导入项目时,发现之前项目的butter knife报错,用到注解的应该都会报错Error:Execution failed for task ':app:javaPreCompileDebug'.&g ...
- 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 ...
- AndroidStudio3.0 Canary 8注解报错Annotation processors must be explicitly declared now.
体验最新版AndroidStudio3. Canary 8的时候,发现之前项目的butter knife报错,用到注解的应该都会报错 Error:Execution failed for task ' ...
- Android Studio 3.0+ Annotation processors must be explicitly declared now
把Android Studio 升级到3.0+ 版本的时候出现该问题: 可以看到 给了我们两种解决办法: 1. 即 给出现问题的三方 加上 annotationProcessor配置 ...
- 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 ...
- 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 ...
- 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 ...
- 关于VS编译报错,但是错误信息未提示问题解决方案
可能代码中引用了别的类库中的函数,然后未编译被引用库导致编译报错,重新编译被引用库然后再编译当前库即可解决问题
随机推荐
- jmeter性能测试-高并发分布式部署
jmeter什么要做分布式部署? jmeter是运行在JVM虚拟机上的,当模拟大量并发时,对运行机器的性能/网络负载会很大. 此时就需要使用jmeter的分布式部署功能,实现多台被控机器同时并发访问被 ...
- 多任务-python实现-进程(2.1.7)
@ 目录 1.进程是什么 2.进程的生命周期 3.Python中多进程的实现 4.进程和线程的区别 1.进程是什么 进程(Process)是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源 ...
- SpringBoot从入门到精通教程(二)
SpringBoot 是为了简化 Spring 应用的创建.运行.调试.部署等一系列问题而诞生的产物,自动装配的特性让我们可以更好的关注业务本身而不是外部的XML配置,我们只需遵循规范,引入相关的依赖 ...
- 一劳永逸,解决基于 keep-alive 的后台多级路由缓存问题
用过 vue-element-admin 的同学一定很清楚,路由的配置直接关系侧边栏导航菜单的展示,也得益于这种设计思路,几乎大部分后台框架都采用这个方案,当然也包括了我写的 Fantastic-ad ...
- rocketMq broker.conf全部参数解释
#4.7.1版本 #所属集群名字brokerClusterName=rocketmq-cluster#broker名字,名字可重复,为了管理,每个master起一个名字,他的slave同他,eg:Am ...
- 1.Redis基础命令
重要概念 redis是单线程模型,所有命令都会进入一个队列,然后依次被执行. 全局命令 >>>select dbindex #切换数据库,默认有16个库,库标识符为0-15 > ...
- JPA 复杂查询 - Querydsl
添加依赖 <!--query dsl --> <dependency> <groupId>com.querydsl</groupId> <art ...
- 加班申请单flowable中
/* * Copyright (c) 2018-2028, Chill Zhuang All rights reserved. * * Redistribution and use in source ...
- list转long[]数组
//list转long数组List<Long> list = new ArrayList<>(); Long[] skuIds = list.toArray(new Long[ ...
- JQuery特点:
轻量级 强大的选择器 出色的DOM封装 可靠的事件处理机制 完善的Ajax 出色的浏览器兼容性 丰富的插件支持 完善的文档 支持链式操作