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 版本注意事项的更多相关文章

  1. 【Android 应用开发】 Android 各种版本简介 ( Support 支持库版本 | Android Studio 版本 | Gradle 版本 | jcenter 库版本 )

    初学者遇到 Android Studio, 导入工程后, 会出现各种奇葩错误, 如果管理好各个插件, gradle, SDK, SDK Tools, 各种官方依赖库 的版本, 会将错误大大的减少; 这 ...

  2. 修改Android Studio默认的API Level(SDK版本)

    原文:修改Android Studio默认的API Level(SDK版本) Android Studio(2.1.2)新建工程的时候只会让你选择最低支持的SDK版本,默认的目标编译SDK版本会以系统 ...

  3. Android Studio中一套代码多版本打包

    一套代码达到以下效果: 打包不同applicationId能同时安装在同一手机上 不同logo,app名称, 不同第三方SDK接入配置(例如微信分享appid,激光推送appkey) 能区分debug ...

  4. Visual Studio Emulator for Android 初体验

    Visual Studio Emulator for Android已经推出一段时间了,但一直没有用过.前两天下载安装用了下,整体感觉比谷歌自带的模拟器强多了.Visual Studio Emulat ...

  5. 2.[WP Developer体验Andriod开发]Andriod Studio结合Visual Studio Emulator for Android调试Android App

    0. 工欲善其事必先利其器 上一篇博客对比了一下Android和WinPhnoe的布局容器,后续篇章重点放在Android的开发上了. 说到开发就绕不开调试程序,调试Android App我们有2种选 ...

  6. [.net程序员必看]微软新动向之Android和IOS应用 visual studio 2015 Cordova[原创]

    自萨蒂亚·纳德拉(Satya Nadella)上任微软CEO以来,可谓是惊喜不断,仿佛让世界尤其是我们.net程序员心中又燃起了希望.先是免费提供 iOS 版和安卓版 Office:然后在 xbox ...

  7. 利用Visual GDB在Visual Studio中进行Android开发

    转载请注明http://www.cnblogs.com/adong7639/p/4119467.html 无意中发现了Visual GDB这个工具,可以再Visual Studio中进行Android ...

  8. Android学习系列(42)--Android Studio实战技巧

    使用android studio开发项目的一些问题,功能和技巧. 1. 环境 Mac OSX 10.9.5 + Android Studio 0.8.9 2. gradle项目加载超慢 这是因为gra ...

  9. 使用Visual Studio 2015开发Android 程序

    环境配置: 操作系统:win 7 64位 IDE:Visual Studio 2015 SDK:installer_r24.3.3-windows 安装前提: 编辑hosts文件(在附件可下载)因为安 ...

随机推荐

  1. 关于Linux虚拟化技术KVM的科普 科普四(From humjb_1983)

    另一组关于KVM的分析文档,虚拟化相关概念.KVM基本原理和架构一-概念和术语.KVM基本原理和架构二-基本原理.KVM基本原理及架构三-CPU虚拟化.KVM基本原理及架构四-内存虚拟化.KVM基本原 ...

  2. sql server 分区(上)

    分区发展历程      基于表的分区功能为简化分区表的创建和维护过程提供了灵活性和更好的性能.追溯到逻辑分区表和手动分区表的功能. 二.为什么要进行分区 为了改善大型表以及具有各种访问模式的表的可伸缩 ...

  3. nake_api_protect 请求保护器——防止请求被恶意刷

    github : https://github.com/xjnotxj/wechat_interaction_auth -- nake_api_protect 接口请求保护器,根据 频率 + 次数 的 ...

  4. FreeRTOS数据结构(一)--链表和链表项

    结构体定义 /*链表结构体*/ typedef struct xLIST { listFIRST_LIST_INTEGRITY_CHECK_VALUE /*用于链表完整性检查*/ configLIST ...

  5. Python实现控制台密码星号输入

    import msvcrt, sys, os print('password: ', end='', flush=True) li = [] while 1: ch = msvcrt.getch() ...

  6. Python 时间模块

    模块分类 标准库 python解释器自带的, sys, os等 开源模块 比如selenium中的测试框架 自定义模块 比如自己封装的测试框架 时间格式 时间戳 当前时间减去1970年1月1日00:0 ...

  7. JAVA经典算法40题(原题+分析)之分析

    JAVA经典算法40题(下) [程序1]   有一对兔子,从出生后第3个月起每个月都生一对兔子,小兔子长到第四个月后每个月又生一对兔子,假如兔子都不死,问每个月的兔子总数为多少?   1.程序分析:  ...

  8. java 自定义的注解有什么作用

    转自https://zhidao.baidu.com/question/1668622526729638507.html 自定义注解,可以应用到反射中,比如自己写个小框架. 如实现实体类某些属性不自动 ...

  9. 【莫比乌斯反演】BZOJ2820 YY的GCD

    Description 求有多少对(x,y)的gcd为素数,x<=n,y<=m.n,m<=1e7,T<=1e4. Solution 因为题目要求gcd为素数的,那么我们就只考虑 ...

  10. BZOJ_1260_[CQOI2007]涂色paint _区间DP

    BZOJ_1260_[CQOI2007]涂色paint _区间DP 题意: 假设你有一条长度为5的木版,初始时没有涂过任何颜色.你希望把它的5个单位长度分别涂上红.绿.蓝.绿.红色,用一个长度为5的字 ...