一分钟搞定 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.)
    }
}

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM