一分钟搞定 Android studio 2.3项目升级到3.0

此类文章有点多,但很杂乱 我在这里做个综合 希望对大家有用

1. APP级别,依赖库 下的 build.gradle文件

  dependencies 下所有的

(1)   compile  替换成  implementation

(2)   androidTestCompile 替换成    androidTestImplementation

(3)   testCompile  替换成   testImplementation

(4)   在 defaultConfig 中 新增一条属性   flavorDimensions "versionCode"  此条属性可以保证 每个项目中的版本一致(此条属性 只需在主APP中添加即可

(5)   如果 是28版本 需要 将此属性改成最高版本 buildToolsVersion '28.0.3'

 

2.project级别下的 build.gradle 文件 添加 Google()

allprojects {
    repositories {
        jcenter()
        google()//新增的(原因:android studio 升级到了3.0 取消了apt 报了这个错 android Could not find com.android.tools.build:aapt2:3.2.1-4818971.)
    }
}

 


 

posted on 2018-10-17 10:45  LKit  阅读(1943)  评论(0编辑  收藏  举报