Android Studio3.0.1版本更新后遇到的问题
2017-11-30 14:03
281 查看
在更新 新版AndroidStudio3.0.1的时候(原来用的是2.1版本),遇到的两个问题,感觉有必要注明一下
问题一、编译时报错Error:Removing unused resources requires unused code shrinking to be turned on.
修改build.gradle文件,下面标红代码就是
问题二、运行时报错
> 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 (com.jakewharton:butterknife:7.0.1)
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中添加
问题一、编译时报错Error:Removing unused resources requires unused code shrinking to be turned on.
修改build.gradle文件,下面标红代码就是
buildTypes { debug { signingConfig signingConfigs.release buildConfigField "boolean", "ISDEBUG", "true" debuggable true minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } release { signingConfig signingConfigs.release minifyEnabled true zipAlignEnabled true debuggable true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }
问题二、运行时报错
> 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 (com.jakewharton:butterknife:7.0.1)
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 } } } ... }
相关文章推荐
- [转]更新Android SDK到3.0版本时,遇到Failed to rename directory E:\android\tools to E:\android\temp\ToolPackage.old01问题
- Android版本更新时对SQLite数据库升级或者降级遇到的问题
- 我遇到的问题是,更新android studio3.0.1版本之后,preview界面无法正常显示
- Android Studio在打包release版本时遇到国际化的问题
- 对Android中的apk文件进行数字签名及版本更新时遇到apk签名问题
- Android版本更新时对SQLite数据库升级或者降级遇到的问题
- Android版本更新时对SQLite数据库升级或者降级遇到的问题
- Android studio appcompat-v7 更新23.0.x版本后出现问题
- 更新Android SDK到3.0版本时,遇到Failed to rename directory E:\android\tools to E:\android\temp\ToolPackage.old01问题
- [android开发笔记]android中导入版本不一致的project可能会遇到的编译问题
- android 开发中遇到的错误及解决方式(更新R.java文件不能自动更新问题)
- 关于Android 2.2与2.3 adb.exe版本更新问题(在安装android——SDK时候找不到相应的 /tools/adb.exe! )
- 【Android】导入低版本 project到高版本sdk后,遇到的兼容问题的解决
- android中导入低版本project可能会遇到的编译问题
- android的sdk更新遇到的两个问题
- android中导入低版本project可能会遇到的编译问题
- Android的资料库更新遇到的问题
- 关于Android 2.2与2.3 adb.exe版本更新问题(在安装android——SDK时候找不到相应的 /tools/adb.exe! )
- 编写Android app更新模块遇到的问题分析与总结
- Eclipse结合SVN进行版本控制在执行更新时遇到的问题