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

导入项目时,发现之前项目的butter knife报错,用到注解的应该都会报错
Error:Execution failed for task ‘:app: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.
- 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.
See https://developer.android.com/r/tools/annotation-processor-error-message.html for more details.

在app的build中
android {
...
defaultConfig {
...
//添加如下配置就OK了
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
}
...
}

原文地址:https://www.cnblogs.com/leizz/p/10115146.html

时间: 2024-12-09 07:47:34

Android Studio错误日志-注解报错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.

体验最新版AndroidStudio3.0 Canary 8的时候,发现之前项目的butter knife报错,用到注解的应该都会报错 Error:Execution failed for task ':app:javaPreCompileDebug'. > Annotation processors must be explicitly declared now. The following dependencies on the compile classpath are found to

Android Studio编译大工程报错:java.exe'' finished with non-zero exit value 1

版权声明:本文为博主原创文章,未经博主允许不得转载. Android Studio编译大工程报错:java.exe'' finished with non-zero exit value 1

Android Studio 新建Andorid工程报错: Conflict with dependency 'com.android.support:support-annotations'

新建Android工程报错: Error:Execution failed for task ':app:preDebugAndroidTestBuild'. > Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.and

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 processors must be explicitly declared now. The following dependencies on the compile classpath are found to contain annotation processor. Please add them to th

Android Studio添加PNG图片报错原因

今天在网上看到一个关于Splash Activity的Android帖子,博主在一通讲解之后也给出了代码.于是果断下载下来了看看怎么实现的.一步步照着流程把这个功能实现了一遍.一切都没有大问题,但是在gradle编译期间提示报错: libpng error: Not a PNG file  从提示上看很简洁很明了,添加的资源不属于PNG格式的.但是我看了看资源文件夹下的文件,都是PNG格式结尾的.在网上搜了一通后在stackoverflow上发现了一个帖子说:不要光看文件名是*.png结尾的,而

Android Studio Gradle 版本不同报错解决方法

由于GFW的原因,我们在使用as时经常出现失败,或者第一次新建工程不成功. 很多博客上已经提到了如何解决第一次新建工程Gradle构建的问题,那么在打开别的工程时依旧会报错 "Failed to sync Gradle project" 找到build.gradle 更改为你可以运行的Gradle版本 更改版本 成功解决sync失败的问题

Android studio 中,遇到报错:ERROR: x86_64 emulation currently requires hardware acceleration! CPU acceleration status:HAXM must be updated(version 1.1.1<6.0.1)的解决方法

在 Android SDK 的安装目录下找到intelhaxm-android.exe安装即可.忘记目录位置直接在"计算机"中搜索,如果没有,返回Android studio 的"设置",找到 这个图片最下方的内容勾选下载,然后你就会在"计算机"找到intelhaxm-android.exe,然后安装即可

Android Studio添加依赖编译报错

Warning:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for app (3.0.1) and test app (2.0.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details. 原因:由于添加的依赖版本是最新的,而代码仓库里边并没有最新的依赖导致报错 解决办法:在build.gradl

android studio 1.0 gradle报错

1. build.gradle里要写classpath 'com.android.tools.build:gradle:1.0.0' 2. 自己下载个gradle2.2.1,studio里手动指定 3. 更新Android SDK Tools到24.0.1 android studio 1.0 对gradle的变化蛮大的,需要不断查资料解决...