Android Studio 3.0升级小结

今天把AS的版本升级到了3.0,升级过程小结一下。
1、3.0版本需要升级编译工具的版本: buildToolsVersion ‘26.0.2’
2、和apt冲突:
Error:A problem occurred configuring project ‘:app’.

android-apt plugin is incompatible with the Android Gradle plugin. Please use ‘annotationProcessor’ configuration instead.

去掉app的build.gradle中的apply plugin: ‘android-apt’
把apt相关的地方换乘annotationProcessor
如 : apt ‘com.jakewharton:butterknife-compiler:8.8.1’ –> annotationProcessor ‘com.jakewharton:butterknife-compiler:8.8.1’

3、输出APK名称的规则的变更
applicationVariants.all { variant ->
variant.outputs.all {
//outputFileName = “xxx_{defaultConfig.versionCode}_{defaultConfig.versionName}_${variant.productFlavors[0].name}.apk”
}
}

4、版本号相关的冲突:
Error:All flavors must now belong to a named flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html
在defaultConfig 标签中加入:
versionCode=200
versionName=2.0
flavorDimensions “versionCode”

5、和黄油刀的冲突
把黄油刀的版本降下来,原来是8.8.1
classpath ‘com.jakewharton:butterknife-gradle-plugin:8.4.0’

你可能感兴趣的:(网络)