更新支持库的最佳方法

Ank*_*rya 3 android android-appcompat android-support-library android-studio android-gradle-plugin

直到现在(2017年11月30日)谷歌已发布Android支持lib版本27.0.2和Android Api版本27(预览版).现在我的应用程序有Target version 25,Build tool version 25.0.3Compile sdk version 25.我打算更新我的支持库以及编译sdk版本到26.所以我的问题是
1.支持lib版本是否与android Api版本相关意味着我没有将android api更新为27因为它在预览中所以我应该使用支持lib 26.xx或27.xx(这是最新的).
2.我应该使用哪种构建工具版本

Uma*_*air 6

转到API 级别26.因为API 27处于预览模式,所以它现在不稳定.像这样更改你的Build.gradle文件并同步你很好.

android {
compileSdkVersion 26
buildToolsVersion "26.0.3"
defaultConfig {
    applicationId "Your app ID"
    minSdkVersion 16
    targetSdkVersion 26
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner 
   "android.support.test.runner.AndroidJUnitRunner"

}
Run Code Online (Sandbox Code Playgroud)

而且您还必须更新您的依赖项,因为如果您使用旧版本,它们将无法在最新版本中运行.这就是为什么supp lib与android API有关.

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
Run Code Online (Sandbox Code Playgroud)