关于Android Studio 更新到3.0版本以后出现的一些问题以及解决方案
来源:互联网 发布:淘宝直播账号出租平台 编辑:程序博客网 时间:2024/05/21 09:16
分析:尤其是采用butterknife工具的,采用新的Android Studio都会出现这样的问题,我根据提示最后猜测原因可能是Android studio更新,然后gradle更新了,这样的话可能使原来的android-apt工具跟不上节奏了,所以让采用annotationProcessor工具。
解决方法:
1、修改project下的build.gradle当中的依赖
修改之前的代码:
buildscript { repositories { jcenter() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:2.3.3' classpath 'me.tatarka:gradle-retrolambda:3.2.0' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { jcenter() maven { url "https://jitpack.io" } }}task clean(type: Delete) { delete rootProject.buildDir}
修改之后的代码:
buildscript { repositories { jcenter() mavenCentral() google() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files }}allprojects { repositories { jcenter() maven { url "https://jitpack.io" } }}task clean(type: Delete) { delete rootProject.buildDir}
2、然后再修改Module.app里的build.grade里的配置
去除apply plugin: 'android-apt'
3、另外需要把之前apt方式的引用改下,例如:
apt 'com.jakewharton:butterknife-compiler:8.4.0' 改为 annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0' 这种方式。
按照上述方式修改之后,再次运行如果出现下图情形,按照解决方案解决就行,如没有请忽略
解决方案:关掉AAPT2即可 ,在Project/gradle.properties中添加 android.enableAapt2=false
android.enableAapt2=false
也许还会出现下面这个问题,如果出现,就按照下面解决方案解决,如若没有请忽略
报错日志:
Error:Execution failed for task ':CNKI: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. - lombok-1.16.12.jar (org.projectlombok:lombok:1.16.12) 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.
解决方案:在Module.app里的build.grade里的android defaultCondig下添加,即可
javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
以上就是在更新过AS新版以后遇到的问题以及解决方案^_^
阅读全文
0 0
- 关于Android Studio 更新到3.0版本以后出现的一些问题以及解决方案
- Android studio更新到2.2之后出现的问题
- Android studio更新到2.2之后出现的问题
- Android studio更新到2.2之后出现的问题
- 更新Android Studio到2.3.1出现的问题
- Android重新安装以及出现的一些问题和解决方案
- 导入Eclipse工程 到 Android Studio以及出现的问题
- Android Studio更新到3.0以后,预览无法显示 v4,v7包控件的解决方法
- ava.lang.VerifyError 解决方案(Android studio版版更新出现的问题)
- Android Studio离线更新的一些问题
- Android 7.0解析包时出现问题 的解决方案(版本更新)
- android webview出现问题的一些解决方案
- 使用Android studio 出现的一些问题
- android studio更新到最新的版本后项目遇到的问题
- 项目中曾经出现的一些bug以及以后要注意的一些问题
- spring boot版本更新出现的一些问题
- 关于android studio的版本问题
- studio 更新到3.0后报错问题及解决方案
- JMeter源码集成到Eclipse
- 国内几款接口管理平台,使用体验分析对比;总有一款是你想要的!
- BZOJ4580 DP
- create-subclass.js
- 服务器配置反向代理
- 关于Android Studio 更新到3.0版本以后出现的一些问题以及解决方案
- facebook presto源码解读( part3 )
- 《特征工程三部曲》之二:特征选择
- Mybatis注解
- 1
- Linux 下简单的串口编程
- AGI (Analytical Graphics Inc.)
- 看人
- java项目JQ i18n国际化