Android Studio 更新3.0 记录
来源:互联网 发布:淘宝卖家二维码生成 编辑:程序博客网 时间:2024/05/16 05:05
官方指南: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html
3. 报错:The specified Android SDK Build Tools version (26.0.0) is ignored
5. Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
参考资料: http://www.cnblogs.com/whoislcj/p/6148410.html
android-apt 是管理annotation的一个工具,不再更新了。建议使用谷歌官方的annotationProcessor。
删除build.gradle中关于apt的所有内容, dependencies中原来的apt改为annotationProcessor。
6. 报错: java.lang.NoSuchMethodError: No static method getFont
基本上遇到的问题都在官方指南上列出来了,下面列出的是我自己遇到的问题。
1. 下载gradle4.1,一直refresh gradle project卡住不动
参考资料: http://blog.csdn.net/qq_28336351/article/details/74178349
解决办法:手动下载gradle包,再导入。
下载地址: http://services.gradle.org/distributions/
android studio设置:
gradle/wrapper/gradle-wrapper.properties
distributionUrl=file:/Users/用户名/.gradle/wrapper/dists/gradle-4.1-all.zip
2. 报错“Cannot set the value of read-only property 'outputFile' ......“
build.gradle中,
- 修改原来的 each 为 all
- 原来需要指定 outputFile,改为只需要指定 outputFileName
// If you use each() to iterate through the variant objects,// you need to start using all(). That's because each() iterates// through only the objects that already exist during configuration time—// but those object don't exist at configuration time with the new model.// However, all() adapts to the new model by picking up object as they are// added during execution.android.applicationVariants.all { variant -> variant.outputs.all { outputFileName = "${variant.name}-${variant.versionName}.apk" }}
3. 报错:The specified Android SDK Build Tools version (26.0.0) is ignored
按照指示,删除buildToolsVersion,刷新
4. 报错: Could not find com.android.support:cardview-v7:26.0.2.
查看了sdk manager,android support repository已经更新了。
参考资料: https://stackoverflow.com/a/45342389
build.gradle中增加google()
allprojects { repositories { google() jcenter() }}
5. Error:android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
参考资料: http://www.cnblogs.com/whoislcj/p/6148410.html
android-apt 是管理annotation的一个工具,不再更新了。建议使用谷歌官方的annotationProcessor。
删除build.gradle中关于apt的所有内容, dependencies中原来的apt改为annotationProcessor。
//annotationsannotationProcessor "org.androidannotations:androidannotations:$AAVersion"
6. 报错: java.lang.NoSuchMethodError: No static method getFont
原因是多个support包使用了不同的版本,全部统一使用27.0.0,重新build,就可以了。
阅读全文
0 0
- Android Studio 更新3.0 记录
- android studio 用法记录 更新中....
- Android studio 使用记录(持续更新)
- android studio 3.0 更新套路
- 安装Android Studio 3.0记录
- Android Studio更新,3.0正式版来了!
- Android studio更新到3.0后问题解决
- Android Studio 更新
- android studio更新SDK
- android studio 更新方法
- android studio更新失败
- Android Studio更新问题解决
- android studio离线更新
- Android Studio更新
- android studio 手动更新
- Android Studio的更新
- Android studio更新
- Android Studio在线更新
- [考试] [NOIP模拟] [2017-11-01] 极其良(e)心的一次考试
- 如何回答:你有什么样的职业规划
- java基础学习第二讲
- usaco The Castle
- Go语言数组
- Android Studio 更新3.0 记录
- JTA分布式事务实战(atomikos)
- mysql c# 代码中的哪些坑一
- mybatis获取insert之后数据库自动生成的id
- Centos之php安装指定版本-yellowcong
- stick footer布局
- Android 端蓝牙模块的开发
- 入职如何谈薪资
- 【R 语言 数据抽样】将样本总体分为样本集和测试集