打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
AndroidStudio 3.0 canary 8 Annotation processors must be explicitly declared now.

今天由于开发环境问题,下载了最新版的AndroidStudio的,之前的项目编译报错,提示:

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.    - permissionsdispatcher-processor-2.3.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.
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

在project/app/build.gradle的android{defaultConfig{}}中添加:

build.gradle

    apply plugin: 'com.android.application'    ....    androdi{                defaultConfig{                ....                ...                javaCompileOptions {                annotationProcessorOptions {                    includeCompileClasspath true                }        }    }}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

—————————-2017年7月26日15:50:07————————————-

    Information:Gradle tasks [:app:assembleBaiduDebug]C:\Users\Vincent\.gradle\caches\transforms-1\files-1.1\imagepicker-0.5.5.aar\2783c71f1a32429aa98ba1cbe71dc0ae\res\values\values.xmlError:(22, 5) style attribute '@android:attr/windowEnterAnimation' not foundError:(22, 5) style attribute '@android:attr/windowExitAnimation' not foundError:(31, 5) style attribute '@android:attr/windowEnterAnimation' not foundError:(31, 5) style attribute '@android:attr/windowExitAnimation' not foundError:E:\MyProject\Hss\app\build\intermediates\incremental\mergeBaiduDebugResources\merged.dir\values\values.xml:1862 style attribute '@android:attr/windowEnterAnimation' not foundError:E:\MyProject\Hss\app\build\intermediates\incremental\mergeBaiduDebugResources\merged.dir\values\values.xml:2545 style attribute '@android:attr/windowEnterAnimation' not foundError:failed linking referencesError:java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.AaptException: AAPT2 link failed:Error:com.android.builder.internal.aapt.AaptException: AAPT2 link failed:Error:Execution failed for task ':app:processBaiduDebugResources'.> Failed to execute aapt
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13

解决方案:
关掉AAPT2即可
在Project/gradle.properties中添加 android.enableAapt2=false

    android.enableAapt2=false
  • 1

——————–2017年7月27日09:49:33——–

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
解决androidstudio报错问题(FailedtocompleteGradleexecution.)
Android Studio无法启动,gradle下载不了
Android Studio安装及主题字体配置
Gradle多渠道自动化打包(基础篇)
一个异常与Android Studio系列教程参考
Androidstudio 新GradlePlugin和Gradle Version对应关系
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服