Android studio 2 版本升级 Android studio 3 版本注意事项
1. compile 需要改成 implementation 或者 api
例:implementation 'com.android.support:support-v4:23.4.0'
详细规则 https://blog.csdn.net/yuzhiqiang_1993/article/details/78366985
2. apt 需要去掉,改成 annotationProcessor
例:annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.0.1'
3. 多渠道需要这样配置:
例:
defaultConfig {
applicationId "com.roadrover.bluetooth"
minSdkVersion
targetSdkVersion
versionName "2.1.4"
versionCode flavorDimensions "color" // 添加
}
productFlavors {
t3plus {
dimension "color" // 添加
}
imx6 {
dimension "color" // 添加
}
imx6_yutong17a {
dimension "color" // 添加
}
}
4. NDK暂时不要升级最新版本,会影响编译
5. Could not find com.android.tools.lint:lint-gradle:xxxx : allprojects模块的repositories中缺少了google()
例:allprojects {
repositories {
jcenter()
google()
}
}
6. error: style attribute ‘@android:attr/windowEnterAnimation’ not found.
修改前
<style name="remnote_play_time_animation">
<item name="@android:windowEnterAnimation">@anim/remote_play_popup_show</item>
<item name="@android:windowExitAnimation">@anim/remote_play_popup_hide</item>
</style>
修改后
<style name="remnote_play_time_animation">
<item name="android:windowEnterAnimation">@anim/remote_play_popup_show</item>
<item name="android:windowExitAnimation">@anim/remote_play_popup_hide</item>
</style>
7.SDK工具版本
app中的gradle中的
compileSdkVersion 27
buildToolsVersion '27.0.3'
gradle中的wrapper中的distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
project中的gradle的classpath 'com.android.tools.build:gradle:3.1.2'
8.EventBus异常
defaultConfig {
minSdkVersion
targetSdkVersion
javaCompileOptions { // 添加
annotationProcessorOptions {
arguments = [eventBusIndex: "com.example.myapp.MyEventBusIndex"]
}
}
}
dependencies {
api 'com.android.support:support-v4:27.0.0'
api 'org.greenrobot:eventbus:3.1.1' // 添加
annotationProcessor 'org.greenrobot:eventbus-annotation-processor:3.1.1' // 添加
}
9.修改aar文件名字的异常
修改前
libraryVariants.all { variant ->
variant.outputs.each { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "libvlc.aar"
output.outputFile = new File(outputFile.parent, fileName)
}
}
}
修改后
libraryVariants.all { variant ->
variant.outputs.all { output -> // 修改后
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.aar')) {
def fileName = "libvlc.aar"
outputFileName = new File("../../../release/", fileName) // 修改后
}
}
}
10.Android SDK Platform-Tools 版本使用26.0.2
Android studio 2 版本升级 Android studio 3 版本注意事项的更多相关文章
- 【Android 应用开发】 Android 各种版本简介 ( Support 支持库版本 | Android Studio 版本 | Gradle 版本 | jcenter 库版本 )
初学者遇到 Android Studio, 导入工程后, 会出现各种奇葩错误, 如果管理好各个插件, gradle, SDK, SDK Tools, 各种官方依赖库 的版本, 会将错误大大的减少; 这 ...
- 修改Android Studio默认的API Level(SDK版本)
原文:修改Android Studio默认的API Level(SDK版本) Android Studio(2.1.2)新建工程的时候只会让你选择最低支持的SDK版本,默认的目标编译SDK版本会以系统 ...
- Android Studio中一套代码多版本打包
一套代码达到以下效果: 打包不同applicationId能同时安装在同一手机上 不同logo,app名称, 不同第三方SDK接入配置(例如微信分享appid,激光推送appkey) 能区分debug ...
- Visual Studio Emulator for Android 初体验
Visual Studio Emulator for Android已经推出一段时间了,但一直没有用过.前两天下载安装用了下,整体感觉比谷歌自带的模拟器强多了.Visual Studio Emulat ...
- 2.[WP Developer体验Andriod开发]Andriod Studio结合Visual Studio Emulator for Android调试Android App
0. 工欲善其事必先利其器 上一篇博客对比了一下Android和WinPhnoe的布局容器,后续篇章重点放在Android的开发上了. 说到开发就绕不开调试程序,调试Android App我们有2种选 ...
- [.net程序员必看]微软新动向之Android和IOS应用 visual studio 2015 Cordova[原创]
自萨蒂亚·纳德拉(Satya Nadella)上任微软CEO以来,可谓是惊喜不断,仿佛让世界尤其是我们.net程序员心中又燃起了希望.先是免费提供 iOS 版和安卓版 Office:然后在 xbox ...
- 利用Visual GDB在Visual Studio中进行Android开发
转载请注明http://www.cnblogs.com/adong7639/p/4119467.html 无意中发现了Visual GDB这个工具,可以再Visual Studio中进行Android ...
- Android学习系列(42)--Android Studio实战技巧
使用android studio开发项目的一些问题,功能和技巧. 1. 环境 Mac OSX 10.9.5 + Android Studio 0.8.9 2. gradle项目加载超慢 这是因为gra ...
- 使用Visual Studio 2015开发Android 程序
环境配置: 操作系统:win 7 64位 IDE:Visual Studio 2015 SDK:installer_r24.3.3-windows 安装前提: 编辑hosts文件(在附件可下载)因为安 ...
随机推荐
- Mysql主从方案的实现
Mysql主从方案介绍 mysql主从方案主要作用: 读写分离,使数据库能支撑更大的并发.在报表中尤其重要.由于部分报表sql语句非常的慢,导致锁表,影响前台服务.如果前台使用master,报表使用s ...
- mysql数据库的权限体系介绍
一.权限体系简介: MySQL的权限体系在实现上比较简单,相关权限信息主要存储在mysql.User.mysql.db.mysql.Host.mysql_table_priv和mysql.column ...
- MVP架构在xamarin android中的简单使用
好几个月没写文章了,使用xamarin android也快接近两年,还有一个月职业生涯就到两个年了,从刚出来啥也不会了,到现在回头看这个项目,真jb操蛋(真辛苦了实施的人了,无数次吐槽怎么这么丑),怪 ...
- elasticsearch 的安装配置与spring boot的整合应用
linux上的elasticsearch安装 一.下载elasticsearch 直接进入elasticsearch的官网,下载最新的安装包:https://www.elastic.co/downlo ...
- Sign http
http接口请求参数签名工具类的实现和测试代码 http://blog.csdn.net/5iasp/article/details/52539901 http://www.what21.com/pr ...
- MongoDB中文档操作(二)
一.插入文档 1.db.集合名.insert() 插入一个:db.user.insert({name:"Join",age:13,address:"beijing& ...
- 用Visual Studio Code Debug世界上最好的语言(Mac篇)
用Visual Studio Code Debug世界上最好的语言(Mac篇) 首先,你要有台Macbook Pro,接着才继续看这个教程. PS:Windows用户看这里用Visual Studio ...
- python3.5中,import sqlite3 出现 no module named _sqlite3的解决方法
我用的centos7.2,系统自带python2.7. 我自己装了python3.5,但在导入sqlite3这个包的时候出现找不到包的错误. 下面给出解决方法. 第一种: 检查自己有没有安装sqlit ...
- Python replace()方法
描述 Python replace() 方法把字符串中的 old(旧字符串) 替换成 new(新字符串),如果指定第三个参数max,则替换不超过 max 次. 语法 replace()方法语法: st ...
- 浅谈cookie,sessionStorage和localStorage
cookie:cookie在浏览器和服务器间来回传递 cookie数据不能超过4k 同时每次http请求都会携带cookie,所以cookie只适合保存很小的数据,比如会话标识 cookie只在设置的 ...