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文件(在附件可下载)因为安 ...
随机推荐
- C Primer Plus 第8章 字符输入/输出和验证输入 编程练习
1. #include <stdio.h> int main(){ char ch; int ct = 0; while ((ch=getchar()) != EOF) ct++; pri ...
- 学unity3d需要什么基础
学unity3d需要什么基础?在游戏业发展如火如荼的情境下,很多人开始转行投身于游戏程序开发,而unity3D游戏开发则是他们必须了解和会用的游戏开发工具.在学习之前又应该了解哪些内容呢? unity ...
- SpringMVC中Json数据格式转换
1 @RequestBody 作用: @RequestBody注解用于读取http请求的内容(字符串),通过springmvc提供的HttpMessageConverter接口将读到的内容转换为 ...
- java 23种设计模式教程
设计模式分类 创建型模式,共五种:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原型模式. 结构型模式,共七种:适配器模式.装饰器模式.代理模式.外观模式.桥接模式.组合模式.享元模式. 行为型模 ...
- Spring Security-- 验证码功能的实现
spring security4 添加验证码 http://www.itwendao.com/article/detail/165400.html http://www.itdadao.com/art ...
- Spring Boot 整合Spring Security 和Swagger2 遇到的问题小结
How to configure Spring Security to allow Swagger URL to be accessed without authentication @Configu ...
- 微信公众号开发 包括服务器配置、java web项目搭建、tomcat手动发布web项目、微信开发所需的url和token验证 2017.12.2
https://www.cnblogs.com/klmei/p/7060879.html 基础配置很全面
- javascript 正则表达式补充
定义 JavaScript种正则表达式有两种定义方式,定义一个匹配类似 <%XXX%> 的字符串 1. 构造函数 var reg=new RegExp('<%[^%>]+%&g ...
- Android 自定义控件 轻松实现360软件详情页
转载请标明出处:http://blog.csdn.net/lmj623565791/article/details/43649913,本文出自:[张鸿洋的博客] 1.概述 最近有不少朋友私聊问应用宝. ...
- HTML5 FormData 方法介绍以及实现文件上传
XMLHttpRequest 是一个浏览器接口,通过它,我们可以使得 Javascript 进行 HTTP (S) 通信.XMLHttpRequest 在现在浏览器中是一种常用的前后台交互数据的方式. ...